Commit a6452038 authored by Jelle Sebreghts's avatar Jelle Sebreghts
Browse files

Issue #1784214 by rafamd: Added Can we use #validate the same as...

Issue #1784214 by rafamd: Added Can we use #validate the same as #element_validate() for custom validations?.
parent e8f09eef
......@@ -22,9 +22,17 @@ function clientside_validation_form_after_build_recurse($form_id, &$form, &$form
$context = array('type' => 'element_validate', 'functions' => $element['#element_validate']);
drupal_alter('clientside_validation_rule', $js_rules, $element, $context);
}
if (isset($element['#validate']) && !empty($element['#validate'])) {
$context = array('type' => 'form_validate', 'functions' => $element['#validate']);
drupal_alter('clientside_validation_rule', $js_rules, $element, $context);
}
clientside_validation_form_after_build_recurse($form_id, $element, $form_state, $js_rules);
}
}
if (isset($form['#validate']) && !empty($form['#validate'])) {
$context = array('type' => 'form_validate', 'functions' => $form['#validate']);
drupal_alter('clientside_validation_rule', $js_rules, $form, $context);
}
}
function clientside_validation_regular($form_id, $element, &$js_rules, $form_state) {
......
Supports Markdown
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