summaryrefslogtreecommitdiff
path: root/includes/form.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/form.inc')
-rw-r--r--includes/form.inc13
1 files changed, 6 insertions, 7 deletions
diff --git a/includes/form.inc b/includes/form.inc
index 310270112..5e75326ff 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -197,6 +197,12 @@ function drupal_submit_form($form_id, $form, $callback = NULL) {
}
function _form_validate($elements, $form_id = NULL) {
+ // Recurse through all children.
+ foreach (element_children($elements) as $key) {
+ if (isset($elements[$key]) && $elements[$key]) {
+ _form_validate($elements[$key]);
+ }
+ }
/* Validate the current input */
if (!$elements['#validated']) {
if (isset($elements['#needs_validation'])) {
@@ -246,13 +252,6 @@ function _form_validate($elements, $form_id = NULL) {
}
$elements['#validated'] = TRUE;
}
-
- // Recurse through all children.
- foreach (element_children($elements) as $key) {
- if (isset($elements[$key]) && $elements[$key]) {
- _form_validate($elements[$key]);
- }
- }
}
/**