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

#54019, Can't set classes on submit elements, patch by m3avrck

parent 0de876d0
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
...@@ -856,7 +856,15 @@ function theme_submit($element) { ...@@ -856,7 +856,15 @@ function theme_submit($element) {
} }
function theme_button($element) { function theme_button($element) {
return '<input type="submit" class="form-'. $element['#button_type'] .'" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n"; //Make sure not to overwrite classes
if (isset($element['#attributes']['class'])) {
$element['#attributes']['class'] = 'form-'. $element['#button_type'] .' '. $element['#attributes']['class'];
}
else {
$element['#attributes']['class'] = 'form-'. $element['#button_type'];
}
return '<input type="submit" '. (empty($element['#name']) ? '' : 'name="'. $element['#name'] .'" ') .'value="'. check_plain($element['#value']) .'" '. drupal_attributes($element['#attributes']) ." />\n";
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment