Skip to content

Commit

Permalink
Don't use type="number" for decimal numbers
Browse files Browse the repository at this point in the history
Google Chrome formats decimal point according to locale, treats it as invalid character and trims full stop
  • Loading branch information
vrana committed Jan 10, 2013
1 parent b5ad37f commit 588cb7c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion adminer/include/functions.inc.php
Expand Up @@ -743,7 +743,7 @@ function input($field, $value, $function) {
// int(3) is only a display hint
$maxlength = (!ereg('int', $field["type"]) && preg_match('~^(\\d+)(,(\\d+))?$~', $field["length"], $match) ? ((ereg("binary", $field["type"]) ? 2 : 1) * $match[1] + ($match[3] ? 1 : 0) + ($match[2] && !$field["unsigned"] ? 1 : 0)) : ($types[$field["type"]] ? $types[$field["type"]] + ($field["unsigned"] ? 0 : 1) : 0));
// type='date' and type='time' display localized value which may be confusing, type='datetime' uses 'T' as date and time separator
echo "<input" . (ereg('int|float|double|decimal', $field["type"]) ? " type='number'" : "") . " value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char|binary', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . "$attrs>";
echo "<input" . (ereg('int', $field["type"]) ? " type='number'" : "") . " value='" . h($value) . "'" . ($maxlength ? " maxlength='$maxlength'" : "") . (ereg('char|binary', $field["type"]) && $maxlength > 20 ? " size='40'" : "") . "$attrs>";
}
}
}
Expand Down
1 change: 1 addition & 0 deletions changes.txt
@@ -1,5 +1,6 @@
Adminer 3.6.3-dev:
Treat Meta key same as Ctrl
Don't use type="number" for decimal numbers

Adminer 3.6.2 (released 2012-12-21):
Edit values by Ctrl+click instead of double click
Expand Down

0 comments on commit 588cb7c

Please sign in to comment.