Feature #39214

The textfield viewhelper should have an attribute 'step' to allow decimal numbers

Added by Thomas Kirst about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Should have
Category:
ViewHelpers
Start date:
2012-07-24
Due date:
% Done:

0%

Estimated time:
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:

[[textfield_stepAny_patch.txt]]


Files

textfield_stepAny_patch.txt (986 Bytes) textfield_stepAny_patch.txt Thomas Kirst, 2012-07-24 13:05
number_keypad_sample.png (40 KB) number_keypad_sample.png Thomas Kirst, 2012-07-24 13:05
#1

Updated by Karsten Dambekalns about 9 years ago

  • Target version set to 2.0 beta 1
#2

Updated by Bastian Waidelich about 9 years ago

  • Status changed from New to Needs Feedback
  • Assignee 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:

<f:form.textfield type="number" additionalAttributes="{step: 123}" />

#3

Updated by Thomas Kirst about 9 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 9 years ago

  • Status changed from Needs Feedback to Closed

Cool, thanks for the feedback!

Also available in: Atom PDF