Project

General

Profile

Actions

Bug #94930

closed

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

Added by S P over 3 years ago. Updated about 1 month ago.

Status:
Closed
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 #1

Updated by S P about 3 years ago

  • TYPO3 Version changed from 9 to 10
Actions #2

Updated by S P about 1 month ago

Can be closed, works on v12. "eval => num" renders as type="text" , and for type="number" there is a dedicated TCA type "number"

Actions #3

Updated by Oliver Bartsch about 1 month ago

  • Status changed from New to Closed

Closed as requested by the author.

Actions

Also available in: Atom PDF