jquery-validation / jquery-validation

jQuery Validation Plugin library sources

Home Page:https://jqueryvalidation.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Min and max does not work with number: true

vikaskanani opened this issue · comments

When you use number: true and apply min, then it gives error of Please enter a value greater than or equal to {{number}}

It should parse number with , formatted and the use min-max validation

https://jsbin.com/xesutom/1/edit?html,output

how about just using:

<input type="number" name="field" value="44.451" required min="13" step="any">

min expects type number.

The input value="44,451" is ambiguous.

Is the ',' a typo?
Is the value Currency or a Number?

min expects type number.

The input value="44,451" is ambiguous.

Is the ',' a typo? Is the value Currency or a Number?

I agree with you.

',' is not clear.

By using <input type="number"> you would then precent the decimal separator to what the user is most comfortable pure visual only, but it gets normalized to dot . when accessing the value with javascript or posting the form to the backend

they would then also be able to use both comma and dot.