Hi all,
I am trying out an easy example from the gravityforms documentation
For some reason the piece of code provided by the documentation is not behaving as expected. Only a small part of the code is being executed, the rest is not.
I am using the Code Snippets plugin for this, with the “Run this snippet everywhere” option enabled, which means that it should run on all themes and child themes etc.
Here is my code (almost identical to what is provided from the documentation with small modifications and prints added):
JQuery(document).ready(function(){
console.log(“Code from snippet”) <-- I can see this printed in the web console
Anything below this line is not being executed (I.E I am not getting the prints in the console)
jQuery(document).on('gform_confirmation_loaded', function(event, formId){
console.log("Confirmation loaded")
if(formId == 3) {
console.log("Form 3 confirmation")
} else if(formId == 2) {
console.log("Form 2 confirmation")
}
});
})
Obs: I have removed the opening and closing script tags, since the was not allowed here for some reason
Any suggestions to why everything within:
jQuery(document).on(‘gform_confirmation_loaded’, function(event, formId){… is not executed?