Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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