Commit ec814bb0 authored by git's avatar git Committed by Peter Droogmans
Browse files

Issue #2681371 by davy-r: webform_validation regexi support is missing

parent 7a682f2d
...@@ -319,10 +319,16 @@ function clientside_validation_webform_add_webform_validation($form_id, &$form, ...@@ -319,10 +319,16 @@ function clientside_validation_webform_add_webform_validation($form_id, &$form,
} }
break; break;
case 'regex': case 'regex':
case 'regexi':
foreach ($webform_validation_rule['components'] as $component) { foreach ($webform_validation_rule['components'] as $component) {
if ($webform_validation_rule['validator'] == 'regexi') {
$modifiers = 'i';
} else {
$modifiers = '';
}
$message = $webform_validation_rule['error_message']; $message = $webform_validation_rule['error_message'];
$expression = $webform_validation_rule['data']; $expression = $webform_validation_rule['data'];
_clientside_validation_set_regex($component['element_name'], $component['element_title'], $js_rules, $expression, $message, '', 'regex', $negate); _clientside_validation_set_regex($component['element_name'], $component['element_title'], $js_rules, $expression, $message, $modifiers, 'regex', $negate);
} }
break; break;
case 'must_be_empty': case 'must_be_empty':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment