bookmark_bordergform_confirmation_loaded

Description

Fired on AJAX-enabled forms when the confirmation page is loaded.

Usage

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

Parameters

  • event [JS Object|object]

    The Javascript event object.

  • formId integer

    The ID of the form submitted.

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).bind('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).bind('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_detail.php