You are here

function callback_webfom_conditional_comparison_operator in Webform 7.4

Evaluate the operator for a given set of values.

This function will be called two times with potentially different kinds of values: Once in _webform_client_form_validate() before any of the validate handlers or the _webform_submit_COMPONENT() callback is called, and once in webform_client_form_pages() after those handlers have been called.

Parameters

array $input_values: The values received from the browser.

mixed $rule_value: The value as configured in the form callback.

array $component: The component for which we are evaluating the operator.

Return value

bool The operation result.

Related topics

File

./webform.api.php, line 1526
Sample hooks demonstrating usage in Webform.

Code

function callback_webfom_conditional_comparison_operator(array $input_values, $rule_value, array $component) {
  foreach ($input_values as $value) {
    if (strcasecmp($value, $rule_value)) {
      return TRUE;
    }
  }
  return FALSE;
}