Project

General

Profile

Actions

Bug #94930

open

TCA eval num wrongly renders input field as HTML type=number

Added by Stefan P almost 3 years ago. Updated over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2021-08-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Actions

Also available in: Atom PDF