Reputation: 9240
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
Upvotes: 8
Views: 14401
Reputation: 85388
Try adding the step attribute:
Example:
<input type="number" step="0.01" min="0" >
Upvotes: 16