• Resolved fdcommunication

    (@fdcommunication)


    Hello,
    I have a form installed on an Elementor popup via the widget (not the shortcode). Some time ago I had a problem with a double button or datepicker not appearing, which had been fixed by enabling “Prevent caching of pages containing forms”. But about 1 week ago, the problem returned on Chrome, so I managed to fix it by enabling “Load form using AJAX”. Except that when AJAX is activated, the Captcha container no longer appears and creates an error during validation.
    So I’m going to disable Captcha until I find a solution.
    For your information, everything is up to date.
    What can I do?

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

    (@wpmudevsupport14)

    Hi @fdcommunication,

    Sorry to know that you are having an issue.

    Since a page URL where we can notice the issue was not provided, I wasn’t able to take a closer look at the issue.

    Can you please share an export of the form so that we can check this further? Please share the export of the form using Google Drive or DropBox.

    I hope the following guide comes in handy: https://wpmudev.com/docs/wpmu-dev-plugins/forminator/#import-export

    Kind Regards,
    Nebu John

    Thread Starter fdcommunication

    (@fdcommunication)

    Hello,

    Here is the URL, but I delete Captcha field for the moment : https://trip-a-velo.com/nos-sejours-val-de-loire/3-jours/week-end-velo-en-famille-chateaux-de-la-loire-en-touraine/. You can click on “Demander une devis”.

    And here is the export : https://docs.google.com/document/d/1PVDZalAAPoF0sVzw_xGZN33kUK5zxaGqS3iwYr4Nlhc/edit?usp=sharing.

    Plugin Support Laura – WPMU DEV Support

    (@wpmudev-support8)

    Hi @fdcommunication

    Thanks for response and sharing the form.

    Here is what I tried:

    – I’ve added Google reCaptcha to the form (basic V2 Checkbox version)
    – I created popup in Elementor
    – I put the form on popup using form widget (not shortcode)
    – and set popup to show on all singular pages

    Then I navigated to some test page on my site and went through the form. Captcha was there on the last screen before submission, as expected.

    I also tried to submit the form and it did work too with proper captcha validation.

    —–

    Since this worked, let me ask:

    – did you check with different types of captcha and it’s the same with all of them? If not – which one specifically should I test?

    – perhaps you could duplicate the form and popup and put it on some temporary test page on your site – with captcha – then point us to that page so we could test it there, live on your site to see how it behaves there and if there are any errors reported in browser console?

    Kind regards,
    Adam

    Thread Starter fdcommunication

    (@fdcommunication)

    Hello,

    I had configured the V3, so I tried with the V2 Checkbox, but the problem persists.

    You can test on this url : https://trip-a-velo.com/voyage-sur-mesure/.

    Plugin Support Laura – WPMU DEV Support

    (@wpmudev-support8)

    Hi @fdcommunication

    Thanks for response!

    I can see the issue on your site indeed. There’s no any related errors in browser console but upon further testing on my own setup – it seems I was able to replicate this to some degree.

    You mentioned earlier that in the past it was fixed by switching the “Load form using AJAX” option and it does seem to be the case still but I see certain pattern here:

    1. if you have “Elementor -> Settings -> Advanced -> CSS Print Method” option set to “External File”: make sure that in Forminator in form’s “Behavior” settings you have
    – “prevent page caching on form pages” option enabled
    – but “Load form using AJAX” is disabled

    2. if you have “CSS Print Method” option set to “Internal embedding” in Elementor settings
    – “Load form using AJAX” shouldn’t matter
    – but the “Prevent page caching on form pages” seems to be still making a difference.

    3. Additionally, you may need to adjust following options on “Elementor -> Settings -> Features” page:

    a) “Form submissions” – set to “Default”
    b) “improved Asset Loading” – try disabling it

    Kind regards,
    Adam

    Thread Starter fdcommunication

    (@fdcommunication)

    Hello,

    I tried what you recommended but it couldn’t work, because as mentioned in my first message, if I disable AJAX, I have a duplicate button problem.
    And I didn’t want to change Elementor’s printing method at the risk of losing performance, as mentioned by Elementor, for a simple Captcha…

    But I still managed to solve the problem and here is how I did it:
    As recommended by you, I disabled all Elementor features in Settings, and disabled AJAX. The problem of double buttons or Captcha were gone. So I reactivated each optimization one by one, until I found the one that was causing the problem of double buttons. This is the “Improved resource loading” setting.

    So I’m going to leave it disabled until Elementor or yourself, Forminator, comes to fix the problem in a future update.

    Thank you for your help and time.

    Plugin Support Nithin – WPMU DEV Support

    (@wpmudevsupport11)

    Hi @fdcommunication,

    Thanks for providing further information, however, I’m not able to replicate the issue specifically with the “Improved Assets Loading” feature, however, I’m bringing this to our developer’s attention to investigate the anomalies noticed to see if it’s something which needs further improvements.

    Best Regards,

    Nithin

    Plugin Support Nebu John – WPMU DEV Support

    (@wpmudevsupport14)

    Hi @fdcommunication,

    Could you please try the following workaround and see if it helps to resolve the issue?

    <?php
    add_action(
    	'wp_footer',
    	function() {
    		?>
            <script type="text/javascript">
            jQuery(document).ready(function($){
                $(document).on('elementor/popup/show', (e, id) => {
                    setTimeout(function(){
                        if ( $('#elementor-popup-modal-'+id).find('.forminator-custom-form').length > 0 ) {
                            forminator_render_captcha();
                        }
                    },800);
                });
            });
    		</script>
    		<?php
    	},
    	9999
    );

    The code could be added using a mu-plugin. I hope the following documentation helps: https://wpmudev.com/docs/using-wordpress/installing-wordpress-plugins/#installing-mu-plugins

    Please feel free to get back to us if you need any further clarification.

    Kind Regards,
    Nebu John

    Thread Starter fdcommunication

    (@fdcommunication)

    Hello,

    Thank your for the code, so I inserted it in Code Snippets plugin. And then I made test with and without AJAX :

    • I enable “Improved Assets Loading” in Elementor settings, and “Prevent caching of pages containing forms” in Forminator settings. But disable AJAX.
    • The problem of duplicate buttons in the form had therefore returned.

    OR

    • I enable “Improved Assets Loading” in Elementor settings, “Prevent caching of pages containing forms” and AJAX in Forminator settings.
    • The problem of CAPTCHA had returned too.

    Here is a doc with screenshots : https://docs.google.com/document/d/1PVDZalAAPoF0sVzw_xGZN33kUK5zxaGqS3iwYr4Nlhc/edit?usp=sharing

    In the code should I replace “id” with the id of my form to make it work? Ideally I would prefer not to use AJAX because it creates latency in the appearance of the form. So maybe resolving the double button conflict with “Improve Asset Loading” would be a better option?

    Plugin Support Laura – WPMU DEV Support

    (@wpmudev-support8)

    Hi @fdcommunication

    No, in the code you do not replace anything – you should use it “as is”.

    Personally, I would indeed lean towards the “improve asset loading” solution rather than adding additional code as I usually tend to limit the amount of custom “workaround code” to the bare minimum but that is up to you – whichever works or works better for you.

    The “improve asset loading” option is supposed to speed up site performance but its impact is also individual and on some sites it makes huge difference while on some is rather small or negligible so if in this case it’s an acceptable “sacrifice” – I’d go for that.

    Best regards,
    Adam

    Thread Starter fdcommunication

    (@fdcommunication)

    In any case, the code given above doesn’t change anything at all, so the choice is quickly made ^^. What was it supposed to do? Force the recaptcha field to appear?

    As I said, if in the future an update to Elementor or Forminator allowed better support for the “Improve Assets Loading” option that would be great. In the meantime, as you say, it will remain disabled.

    Plugin Support Williams – WPMU DEV Support

    (@wpmudevsupport3)

    Hi @fdcommunication,

    Hope this message finds you well.

    The code will not force reCaptcha field to show, but it does add a delay to load, our Devs explained that the Elementor Pop-up does load using Ajax too and its response does take time.

    Still, this was reported to our Forminator devs team for future improvement.

    Best regards,
    Laura

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Invalid Captcha with Ajax enabled’ is closed to new replies.