1

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

1 Answer 1

1

Just include a dot in the character class.

[0-9.]*

Note that this is also "zero or more digits and dots."

Sign up to request clarification or add additional context in comments.

2 Comments

yeah this gives me the normal keyboard. I'm looking for the phone keyboard but also with a dot
yeah I think this is the only option all though it gives me everything else not just numbers and a dot. Thanks for that!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.