We are hosting wordpress sites on wpengine. On this one site we are using gravity forms but for some reason it stopped working. All we get is a js error
Uncaught ReferenceError: gformInitSpinner is not defined (index):135
(anonymous function) (index):135
o jquery.min.js:2
p.fireWith jquery.min.js:2
e.extend.ready jquery.min.js:2
c.addEventListener.B
Now if I set up the site on my local machine it works perfectly fine. Has anyone come across this problem? Anyone got any idea why this is happening?
Why is 'display:none' being added and my form isn't showing up? This is because you have conditional logic being used on your form. Anytime conditional logic is present the entire form is set to display: none; and then JavaScript is used to only show the fields that should be shown.
Finally, there is an easy way to add custom Javascript to your Gravity Forms that only loads when the form is rendered. Just copy-and-paste your desired snippet into the robust editor on your Form Settings and you're golden.
Enabling Gravity Forms AJAX in the Block EditorStart by editing the page where your form is embedded. Next, locate the “Gravity Forms” block and click on it to open the Block Settings in the right-hand panel. Now open the “Advanced” settings panel and toggle “AJAX” on.
Gravityforms.com is UP and reachable by us.
The most common cause of this issue is the gravityforms.js file being included down in the footer when it should be up in the header.
If you are embedding the form using the function call there is a second function call you should use to include the scripts and stylesheets in the header.php
// gravity_form_enqueue_scripts($form_id, $ajax);
gravity_form_enqueue_scripts(4, true);
https://docs.gravityforms.com/gravity_form_enqueue_scripts/
You can also add the GF`s necessary scripts manually to header.php (no actions with registering/deregistering jQuery needed!). Example:
<link rel='stylesheet' id='gforms_formsmain_css-css' href='/wp-content/plugins/gravityforms/css/formsmain.min.css' type='text/css' media='all' />
<link rel='stylesheet' id='gforms_ready_class_css-css' href='/wp-content/plugins/gravityforms/css/readyclass.min.css' type='text/css' media='all' />
<link rel='stylesheet' id='gforms_browsers_css-css' href='/wp-content/plugins/gravityforms/css/browsers.min.css' type='text/css' media='all' />
<script type='text/javascript' src='/wp-content/plugins/gravityforms/js/jquery.json-1.3.js'></script>
<script type='text/javascript' src='/wp-content/plugins/gravityforms/js/gravityforms.min.js'></script>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With