Fire JavaScript is not working
-
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.
- The topic ‘Fire JavaScript is not working’ is closed to new replies.