Don't use type="number" for decimal numbers

Google Chrome formats decimal point according to locale, treats it as invalid character and trims full stop
This commit is contained in:
Jakub Vrana 2013-01-09 18:42:46 -08:00
parent b5ad37ff2b
commit 588cb7c0c3
2 changed files with 2 additions and 1 deletions

View file

@ -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>";
}
}
}

View file

@ -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