You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 12, 2021. It is now read-only.
Expect "010" to be false in numericality validator
Description:
It will be great if there is an option like noLeadingZero in numericality.
Why
Value from HTML5 number box is string
The coercion of + will force "010" to be 10
Facts above make 010 to be a valid number which it should not be in reality in my opinion.
JS:
varc={"numericality": {"greaterThanOrEqualTo":1,"lessThanOrEqualTo":100,"message":"<id> from 1 to 100",},"presence": true,};// Expect to be false, but get trueconsole.log('validation result ',validate.single('010',c));// No problemconsole.log('validation result ',validate.single('10',c));