The gform_conditional_logic_values_input JavaScript filter in Gravity Forms allows filtering the input string provided for the conditional logic comparison value.


gform.addFilter( 'gform_conditional_logic_values_input', function( str, objectType, ruleIndex, selectedFieldId, selectedValue  ) {
    // do stuff
    return str;
} );


  • str string
    String of the HTML input tag.
  • objectType string
    The type of object: page, field, next_button, confirmation, notification.
  • ruleIndex int
    The index of the rule. The first rule is indexed at 0.
  • selectedFieldId int
    The ID of the field chosen for comparison.
  • selectedValue string
    The value used for comparison.


add_action( 'admin_print_scripts', function () {
	if ( method_exists( 'GFForms', 'is_gravity_page' ) && GFForms::is_gravity_page() ) { ?>
        <script type="text/javascript">
            gform.addFilter( 'gform_conditional_logic_values_input', 'set_rule_info' );
            function set_rule_info( str, objectType, ruleIndex, selectedFieldId, selectedValue ){
                str = str.replace('Enter a value', 'Enter the product name');
                return str;
    <?php }
} );


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


This filter was added in Gravity Forms version 1.7.6.

Source Code

This filter is located in the function GetRuleValues() in gravityforms/form_admin.js