Home › Forums › General Issues › Looking for numeric field type documentation
Hi,
I’m a bit lost. I search the documentation of the numeric field type.
I’d like to allow users, to enter numeric values with a dot (.) as decimal separator in a numeric field. But it allows only integer values or values with a decimal comma.
I’d appreciate any helpful hints.
Regards
What are the field settings for the number field where you’re having this issue?
I only set label, name, type ‘numeric’ and that it’s required. Everything else is empty.
Just tried it and I can add decimal point. If you don’t set the “step” value then you must enter the . manually. Scrolling will only show integers. If you want the . and decimal value to show while scrolling the you need to set the step value an set it to something like .1 or .01
Hi,
I also can’t set the step value with a decimal point, but with a decimal comma I don’t get an error message.
It might be a “locale” problem.
I’m just wondering, why it doesn’t work back-end, but outputs as I want it on the front-end site.
Hi,
after reading some posts about input type number I tested different browsers and settings with a simple html form.
Conclusion: The validation of the input type number field depends indeed on the browser, i.e. validation rules vary across browsers. While Firefox applies stricter rules than Chrome, and – as far as I read – Safari.
So, how can I add a radio button in the ACF field settings to choose a lang attribute and then set the input field to it?
I have not dealt with issues related to the formatting of numbers in other languages that use a , instead of . for the decimal separator. I have looked but I have found no information on how this is handled by field and how it can effect validation. As far as I know php only understands the . as the decimal separator, but I could be wrong as I cannot find any information on this. As far as the browser requiring a , I couldn’t begin to tell you how fix this.
The topic ‘Looking for numeric field type documentation’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.