gform_conditional_logic_operators

Description

This JavaScript hook can be used to override the available conditional logic operators.

Usage

gform.addFilter('gform_conditional_logic_operators', function (operators, objectType, fieldId) {
    // do stuff
    return $operators;
});

Parameters

  • operators Javascript Object

    The current operators. e.g.

    {"is":"is","isnot":"isNot", ">":"greaterThan", "<":"lessThan", "contains":"contains", "starts_with":"startsWith", "ends_with":"endsWith"}
  • objectType string

    The current conditional logic object type. Possible values: page, field, next_button, confirmation, notification, or feed_condition.

  • fieldId integer

    The ID of the current field.

Examples

The following example shows how you can specify the available operators.

gform.addFilter('gform_conditional_logic_operators', function (operators, objectType, fieldId) {
    operators = {'>': 'greaterThan'};

    return operators;
});

Source Code

This hook is located in GetRuleOperators() in js/form_admin.js.