• Resolved orbitrix

    (@orbitrix)


    I need to execute the following javascript code after the form submission:
    <script type=”text/javascript”>
    $(document).ready(function() {grecaptcha.execute(‘6LfFrNEZAAAAAPUsHrofFHbEAyaohGajdlmS3fxZ’, {action:’validate_captcha’}).then(function(token) {
    document.getElementsByName(“g-recaptcha-response”)[0].value = token;
    });});
    </script>

    As in the instructions it says “(Don’t use <script> tags)”, I’ve inserted this code in the “Fire JavaScript” field:
    $(document).ready(function() {grecaptcha.execute(‘6LfFrNEZAAAAAPUsHrofFHbEAyaohGajdlmS3fxZ’, {action:’validate_captcha’}).then(function(token) {
    document.getElementsByName(“g-recaptcha-response”)[0].value = token;
    });});

    But the script is not being executed on form submission.
    What can be the problem?
    Thank you very much for your help.

Viewing 1 replies (of 1 total)
  • This is probably related to your code and not our plugin.
    Please check your console – What error are you getting?
    Are you sure you have loaded recaptcha correctly?
    Please provide a link to the page with the contact form.

    • This reply was modified 4 years, 1 month ago by Qube One ltd.
Viewing 1 replies (of 1 total)
  • The topic ‘Fire JavaScript is not working’ is closed to new replies.