gform_frontend_pages_evaluated

gform_frontend_pages_evaluated

DescriptionUsageParametersExamplesLog the parametersPlacementSinceSource Code

Description

The gform_frontend_pages_evaluated JavaScript action hook is used to perform custom actions when page conditional logic rules have been evaulated on the front-end.

Usage

The filter which runs for all would be used like so:

123gform.addAction( 'gform_frontend_pages_evaluated', function( pages, formId, pageLogic ) {    //do something}, 10, 3 );

You can also target a specific form by adding the form id after the hook name.

123gform.addAction( 'gform_frontend_pages_evaluated_6', function( pages, formId, pageLogic ) {    //do something}, 10, 3 );

Parameters

pages array
A collection of page field objects.

formId int
The ID of the current form.

pageLogic JavaScript Object
The currrent GFPageConditionalLogic object.

Examples

Log the parameters

This example would log the contents of the three parameters to the browser console.

123gform.addAction( 'gform_frontend_pages_evaluated', function( pages, formId, pageLogic ) {    console.log( arguments );}, 10, 3 );

Placement

This code should be placed in a theme custom js file or a custom JS functions plugin.

Since

This filter was added in Gravity Forms v2.5.

Source Code

This filter is located in GFPageConditionalLogic.evaluatePages() in page_conditional_logic.js.

發表回覆

您的電子郵箱地址不會被公開。 必填項已用 * 標註