Skip to content

Commit

Permalink
There is no "attr" for simple inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Dec 14, 2017
1 parent d7dc61c commit 40c6ca1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions inc/commondropdown.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,8 @@ function showForm($ID, $options = []) {
} else {
echo Html::input(
$field['name'], [
'attrs' => [
'type' => 'number'
] + $params]
] + $params
);
}
break;
Expand Down
6 changes: 3 additions & 3 deletions inc/html.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -4521,9 +4521,9 @@ static function hidden($fieldName, $options = []) {
**/
static function input($fieldName, $options = []) {
$type = 'text';
if (isset($options['attrs']) && isset($options['attrs']['type'])) {
$type = $options['attrs']['type'];
unset($options['attrs']['type']);
if (isset($options['type'])) {
$type = $options['type'];
unset($options['type']);
}
return sprintf('<input type="%1$s" name="%2$s" %3$s />',
$type, Html::cleanInputText($fieldName), Html::parseAttributes($options));
Expand Down

0 comments on commit 40c6ca1

Please sign in to comment.