Andrey Yakovenko Andrey Yakovenko - 1 year ago 60
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 Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download