• Resolved Jam

    (@dabert3)


    Hi

    I would like to know how to fix this bug. In this video https://www.loom.com/share/381baa8cf9374d04838a77623644bc46, you can see that every first visit of this page, the first 2 clicks on checkbox issue occur. In the first click to checked the checkbox, it looks okay and then when unchecked it, it supposed to show the required error message. But it didn’t.
    It looks fine right after 2-3 clicks. Please check the video.

    Looking forward to your response.

    Jam

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @dabert3,

    I hope you are doing good today.

    Can you please share an export of the form using Google Drive or DropBox to look closely at issue?

    I hope the following documentation helps you with export: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    We look forward to hearing back from you and helping you resolve this issue.

    Kind Regards,
    Nebu John

    Thread Starter Jam

    (@dabert3)

    Hello @wpmudevsupport14

    Thanks for your response. Here, kindly check https://drive.google.com/file/d/16ir0rehpdShh0jZaTffixzw-uFPdjVzZ/view?usp=sharing

    Thank you so much!

    Regards,
    Jam

    • This reply was modified 2 years, 8 months ago by Jam.
    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @dabert3,

    I am afraid I couldn’t import the form using your export, which returns the following error.

    Oops, looks like we found an issue. Import text can not include whitespace or special characters.

    Please make sure you have copied and pasted the code without any changes. Can you please use the download option instead of copying the code?

    https://ibb.co/6HJx2bF

    Kind Regards,
    Nebu John

    Thread Starter Jam

    (@dabert3)

    Hello @wpmudevsupport14

    Actually I did export by clicking the export button. I also check if its valid https://prnt.sc/pwqD8DgCuUSH and there’s no issue in it here at https://jsonlint.com/

    ANyway here’s the 2nd time export file by doing exporting through export button
    https://drive.google.com/file/d/1hyQrM1E03RSjPXOQCFQyVbeSzjNZ3tbS/view?usp=sharing

    Kindly check please.

    Thanks!

    Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @dabert3

    I hope you’re well today!

    I was able to import the form and test it. I’ve then created another form from scratch on my test site and I was able to replicate it there as well.

    Specifically, it isn’t really a matter of “checking few times” but rather that this validation message “kicks in” only after you click in any other field after unchecking the checkbox.

    This isn’t expected behavior, I believe, but it will have to be investigated by our Forminator developers, as I didn’t find any reports on that. I’ve already reported it to our developers as a bug so they’ll check it in order to include a fix in future releases of the plugin.

    Kind regards,
    Adam

    Thread Starter Jam

    (@dabert3)

    Hello @wpmudev-support8

    I’m doing great.

    I see. I did try add custom checkbox here using jQuery insertBefore(), tried console.log() and it worked https://prnt.sc/0ZCZwOYTL2. But it didn’t show the popup and the custom error https://prnt.sc/3bvvjbu1H6In. There was no error in click event in console.

    I tried using filter in forminator checkbox widget but the behavior still the same.

    
    add_filter( 'forminator_custom_form_submit_errors', 'check_form_data', 99, 3 );
    function check_form_data( $submit_errors, $form_id, $field_data_array ) {
        $valid = false;
        foreach( $field_data_array as $val ) {
            if( $val['name'] == 'checkbox-custom' ) { 
                if($val !== null){
                    $valid = true;
                } 
                break;
            }
        }
        
        if( ! $valid ) {
            $submit_errors[]['checkbox-custom'] = 'Checkbox is Required.';
        }
        
        return $submit_errors;
    }

    Is there any alternative way to make this work using the javascript event only (not hooks/filter)?

    Kudos to this best plugin and to devs. I hope they’ll fix it.

    Looking forward to your response.

    Best Regards,
    Jam

    Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @dabert3

    I hope you are doing well.

    It seems this screenshot was removed, https://prnt.sc/0ZCZwOYTL2, can you add it again or share the code that you are using to trigger the PopUp?

    I’m wondering if that is the case because it would change the flow of the checkbox, so I believe you would use a JS for it?

    About the filter, that works only on the PHP level, so if a member submits the form.

    About JS, if you are loading the form from Ajax the on Click wouldn’t work because the form doesn’t exist yet when the JS is loaded on the browser, but you can use:

    $(document).on("after.load.forminator", function (e, id) {

    Then JS inside that event, something like: https://gist.github.com/patrickfreitasdev/cc3d6569c670ad3559e31f58fbaec754

    Another quick question, are you embedding the Form on a page builder or default editors such as Classic editor or Gutenberg?

    Best Regards
    Patrick Freitas

    Thread Starter Jam

    (@dabert3)

    Hello @wpmudevsupport12

    Thanks for the response.

    Here’s the new screenshot https://prnt.sc/MfrkVAK1H7vF.

    Okay I’ll that script.

    for your question, I used Elementor to embed the shortcode.

    Regards,
    jam

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @dabert3,

    Please try the javascript workaround suggested and let us know if that helps.

    We look forward to hearing back from you.

    Kind Regards,
    Nebu John

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @dabert3 ,

    We haven’t heard from you for some time now, so it looks like you don’t need our assistance anymore.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Bug in checkbox?’ is closed to new replies.