Bug #94930
closedTCA eval num wrongly renders input field as HTML type=number
0%
Description
The TCA evals int
and num
render the form field as HTML type="number"
. But this is only valid for int
, not for num
.
The DataHandler and the documentation for num
correctly say that only characters in [0-9] are allowed. So the resulting string is no integer number, still only a string: a "num" evaluated field is according to DataHandler and docs fully valid to contain leading zeros. Just think of german postal codes or custom serial numbers with fixed length but leading zeros. For such fields the up/down buttons that modern browsers render for HTML type="number"
fields are totally wrong in this case. Some Browsers even seem to auto-strip leading zeros in such fields, which is wrong for eval num
.
The correct rendering for "num" would be type="text"
with a pattern="[0-9]*"
(maybe also even respecting min
nand max
already in the pattern and not just in the min
and max
HTML attributes).
Discovered on v9, but seems valid for later versions as well.