Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Instead of resorting to disable the module altogether (as suggest here), I'd like to propose my addition as a new feature (Lisa in that discussion) - allowing to disable client validation for a form element and not just a field:
In the clientside_validation/clientside_validation_form/clientside_validation_form.module file, function clientside_validation_regular, just after this code (line 51):
if (isset($field_info['exclude_cv']) && $field_info['exclude_cv'] == '1') {
$skipvalidation = TRUE;
}
I suggest to add:
elseif (isset($element['#exclude_cv']) && $element['#exclude_cv']) {
//skip validation if defined so by form element
$skipvalidation = TRUE;
}
Then, a developer can disable validation per form element by just setting #exclude_cv to TRUE:
$form['startdate'] = array(
'#type' => 'date_popup',
...
'#exclude_cv' => TRUE,
);
Comments
Comment #1
attiks CreditAttribution: attiks commentedAny chance you can you provide a patch, seems like a good idea
Comment #2
Jelle_SFeature added in the latest dev version