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:
gform.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.
gform.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.
gform.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.