bookmark_bordergform_post_paging

Description

Use this hook to perform actions after going to the next or previous page on a multi-page form.

Usage

add_action( 'gform_post_paging', 'set_default_value', 10, 3 );

You can also specify this per form by adding the form id after the hook name.

add_action( 'gform_post_paging_1', 'set_default_value', 10, 3 );

Parameters

  • $form

    Current form.

  • $source_page_number integer

    Number of page user is coming from.

  • $current_page_number integer

    Current page number.

Example

This example shows how you can use javascript to display a message to the screen when on page two.

add_action( ‘gform_post_paging’, ‘alert_user’, 10, 3 );
function alert_user( $form, $source_page_number, $current_page_number ) {
if ( $current_page_number == 2 ) {
?>

Placement

This code should be placed in the functions.php file of your active theme.

Source Code

This action hook is located in GFFormDisplay::get_form() in form_display.php