Title: Fire JavaScript is not working
Last modified: October 27, 2020

---

# Fire JavaScript is not working

 *  Resolved [orbitrix](https://wordpress.org/support/users/orbitrix/)
 * (@orbitrix)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/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.

Viewing 1 replies (of 1 total)

 *  [Qube One ltd](https://wordpress.org/support/users/querysolutions/)
 * (@querysolutions)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/fire-javascript-is-not-working/#post-13585567)
 * 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 5 years, 6 months ago by [Qube One ltd](https://wordpress.org/support/users/querysolutions/).

Viewing 1 replies (of 1 total)

The topic ‘Fire JavaScript is not working’ is closed to new replies.

 * ![](https://ps.w.org/wpcf7-redirect/assets/icon-256x256.gif?rev=3416723)
 * [Redirection for Contact Form 7](https://wordpress.org/plugins/wpcf7-redirect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpcf7-redirect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpcf7-redirect/)
 * [Active Topics](https://wordpress.org/support/plugin/wpcf7-redirect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpcf7-redirect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpcf7-redirect/reviews/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 1 reply
 * 2 participants
 * Last reply from: [Qube One ltd](https://wordpress.org/support/users/querysolutions/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/fire-javascript-is-not-working/#post-13585567)
 * Status: resolved