Skip to content
Snippets Groups Projects
Commit 6b80d55a authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

#58536, A #required element always needs validation, patch by chx

fixes checkboxes, radios, and selects.
parent ab9f9532
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -366,7 +366,7 @@ function form_builder($form_id, $form) {
}
}
// Mark all posted values for validation
if (isset($form['#value']) && $form['#value'] === $edit) {
if ((isset($form['#value']) && $form['#value'] === $edit) || (isset($form['#required']) && $form['#required'])) {
$form['#needs_validation'] = TRUE;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment