Working on a jQuery Mobile form with an input for entering dollar amounts. <input type="number" name="amount"/>
pops up the numeric entry on devices and restricts to number only. But when I enter a decimal amount and attempt to submit the form, it focuses on the amount field and says "Invalid Value."
How do I keep the theme and data type while allowing digits?
Many thanks
Try adding the step attribute:
Example:
<input type="number" step="0.01" min="0" >
Can also try:
<input type="number" pattern="[0-9.]*">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With