gform_confirmation_loaded

Description

Fired on AJAX-enabled forms when the confirmation message is displayed.

Usage

<script type="text/javascript">
jQuery(document).on('gform_confirmation_loaded', function(event, formId){
    // code to be triggered when the confirmation page is loaded
});
</script>

Parameters

Examples

This event is very useful when the popular font substitution script Cufon is being applied to a Gravity Form which uses the AJAX form submission functionality. The snippet below provides an example usage of the gform_confirmation_loaded event to refresh the Cufon font substitution when the confirmation page is loaded.

<script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery(document).on('gform_confirmation_loaded', function(){
            Cufon.refresh('h1,h2,h3,h4,h5,h6');
        });
    })
</script>

Here is another example where the form ID parameter is used to run different code depending on which form’s confirmation is being loaded.

<script type="text/javascript">
    jQuery(document).ready(function(){

        jQuery(document).on('gform_confirmation_loaded', function(event, formId){
            if(formId == 1) {
                // run code specific to form ID 1
            } else if(formId == 2) {
                // run code specific to form ID 2
            }
        });
    })
</script>

Source Code

This filter is located in form_display.php.