Commit a4494db7 authored by GameOver13's avatar GameOver13 Committed by jelles
Browse files

Issue #2247675 by antongp: Fixed clientside_validation_field_validation: on...

Issue #2247675 by antongp: Fixed clientside_validation_field_validation: on widgets with several form elements validation rule is applied to all widget's form elements.
parent bef66b21
......@@ -129,11 +129,10 @@ function clientside_validation_field_validation_after_build_recurse($form_id, &$
}
function clientside_validation_field_validation_regular($form_id, $element, $rule, &$js_rules) {
if (isset($rule['col']) && $rule['col'] === 'value') {
if (strpos($element['#name'], '[format]') === strlen($element['#name']) - strlen('[format]')) {
return;
}
if (strpos($element['#name'], '[summary]') === strlen($element['#name']) - strlen('[summary]')) {
if (isset($rule['col']) && $rule['col'] !== '') {
$parent_last = end($element['#parents']);
reset($element['#parents']);
if (($parent_last !== FALSE) && ($parent_last !== $rule['col'])) {
return;
}
}
......
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