Reputation: 6952
Hi so I'm trying to get a pattern for an input type text that shows numbers and a dot. Going over the apple documentation I see that one can use basically regex to pull only numbers in the keyboard. Something like
<input type="text" pattern="[0-9]*"></input>
I'm looking for a way to have exactly this but also a dot in the keyboard. Any ideas are much appreciated.
Thanks
Upvotes: 1
Views: 5578
Reputation: 191729
Just include a dot in the character class.
[0-9.]*
Note that this is also "zero or more digits and dots."
Upvotes: 1