bookmark_bordergform_page_loaded

Description

Fires on multi-page forms when changing pages (i.e. going to the next or previous page).

Usage

<script type="text/javascript">
    jQuery(document).bind('gform_page_loaded', function(event, form_id, current_page){
        // code to be trigger when next/previous 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 multi-page functionality and the AJAX form submission functionality. The snippet below provides an example usage of the gform_page_loaded event to refresh the Cufon font substitution for the newly loaded page.

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

        jQuery(document).bind('gform_page_loaded', function(){
            Cufon.refresh('h1,h2,h3,h4,h5,h6');
        });

    });
</script>

This example shows how to add Google Analytics tracking to every page in a multi-page form:

<script type="text/javascript">// <!&#91;CDATA&#91;
jQuery(document).bind('gform_page_loaded', function(event, form_id, current_page){
    _gaq.push(&#91;'_trackPageview'&#93;, window.location.pathname + current_page);
});
// &#93;&#93;></script>

Placement

This code can be placed in an HTML field on your form or you may use the gform_pre_render hook to echo the script block to the page.

Source Code

This filter is located in form_display.php