Feature #39214
The textfield viewhelper should have an attribute 'step' to allow decimal numbers
Status: | Closed | Start date: | 2012-07-24 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Bastian Waidelich | % Done: | 0% |
|
Category: | ViewHelpers | |||
Target version: | TYPO3 Flow Base Distribution - 2.0 beta 1 | |||
Has patch: | Yes |
Description
When using the textfield viewhelper to render a number field it will only accept integer values and no decimals. It is preferable to use the input field of type number which then tells iOS browsers to pull up the number keypad instead of the normal letters keypad. Then it must be possible to enter decimal values, however the default setting of this field is that it just takes integers. The decimal steps can be configured by the 'step' attribute and if you set it on 'any' every decimal number can be entered by the user.
I created a patch file which adds the needed line to the source.
Could anybody please add this patch? Thanks a lot!
Sample screen:
History
#1 Updated by Karsten Dambekalns about 3 years ago
- Target version set to 2.0 beta 1
#2 Updated by Bastian Waidelich about 3 years ago
- Status changed from New to Needs Feedback
- Assigned To set to Bastian Waidelich
IMO that is very specific and there are more possible attributes (like min
& max
). That's why every tag based ViewHelper has the "additionalAttributes" argument.
Could you verify that this works for you:
1<f:form.textfield type="number" additionalAttributes="{step: 123}" />
#3 Updated by Thomas Kirst about 3 years ago
Hi Bastian - thanks for your reply. Yes, the way you suggested works perfectly. I was not aware of the additionalAttributes argument. I changed my source accordingly. We can then close this issue.
Thanks again,
Thomas
#4 Updated by Bastian Waidelich about 3 years ago
- Status changed from Needs Feedback to Closed
Cool, thanks for the feedback!