Gform_confirmation_loaded not running

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?

gform_confirmation_loaded works on AJAX enabled forms only. Is your form embedded with the AJAX option enabled for submission?

Thanks for the reply Chris, to my knowledge, i have enabled AJAX for the form.

I have added the form in Elementor using the shortcode:
[gravityform id=“3” title=“false” description=“false” ajax=“true”]

Anything missing?

After doing some more testing i realized the root cause of the issue:

gform_confirmation_loaded is only working when the confirmation type is set to “Text”.

It does not work when the confirmation type is a WP Page (The way I want to use it), nor when it is a Redirect.

Is there any workaround to fire gform_confirmation_loaded when having a Page as the confirmation type?