Localized Input
Localization issues
How are values rendered in the INPUT field ?
What values can the user enter ?
Depending on (1) supported keyboard on mobile devices and (2) form validation rules applied.
How are values sent to the server ?
And what are the model binding rules there, to interpret the values correctly ?
Notes
- To support decimals, the INPUT must have an attribute STEP="0.01" (for 2 decimals) or STEP="any"
- Negative numbers: they should work but mobile devices may not show them on the keyboard
consider adding a ± button to add or remove a "-" sign on front - ...
Some resources
- MDN Web Docs - <input type="number">
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number - Browser support ofr <input type="number"> with different decimal marks
https://www.ctrl.blog/entry/html5-input-number-localization.html - React Spectrum (Adobe) - How we internationalized our number field
https://react-spectrum.adobe.com/blog/how-we-internationalized-our-numberfield.html - Stackoverflow - Localization of input type number
https://stackoverflow.com/questions/13412204/localization-of-input-type-number - MDN Web Docs - Intl.NumberFormat
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat - MDN Web Docs - inputmode
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode
Test form
Working demo
Loading demo...
Loading...