Andrey Yakovenko Andrey Yakovenko - 6 months ago 11
HTML Question

Can't set few numbers into <input type="number">

I am trying to set few numbers into

<input type="number">
like 22,33,44, but after submited my form, the value into my input tag is "", if I set only two numbers it works like "22.33", but with 3 numbers validation is not pass. How can I set 3 numbers or more and pass the validation?

Answer

Use <input type="text" pattern="(\d+)(,\s*\d+)*" /> instead.

Comments