gform_is_hidden

Description


The gform_is_hidden filter allows developers to customize whether a field is hidden by conditional logic. This is useful in Conversational Forms, where all fields but the current one are hidden.

Usage

gform.addFilter( 'gform_is_hidden', function( isHidden, field ) {
    // Custom logic here
    return isHidden;
}, 10, 2 );

Parameters

Examples

Customize the visibility by marking a field as hidden only if it is wrapped in a .gfield element, excluding those with the class .gfield_hidden_product, and has the data-conditional-logic attribute set to ‘hidden’.

gform.addFilter( 'gform_is_hidden', function( isHidden, field ) { 
	return field.parents('.gfield').not(".gfield_hidden_product").attr("data-conditional-logic") === 'hidden';
}, 10, 2 );

Placement

Reference the article Adding JavaScript Code to the Frontend of Your Site.

Source Code

This filter is located in gravityforms.js.

Since

The filter was added in Gravity Forms 2.8.10

OSZAR »