-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweak to support NUMBER inputs on Mobile. #19
Comments
To clarify, LV works fine with number inputs on desktop, because desktop browsers ignore the unknown number type and treat them as text. But on mobile they are sort of a special case of text input. (Number inputs are cool because the browser will give a number pad rather than full keyboard.) The getElementType function throws an error when it encounters a number input, but only on mobile. |
Here's my complete change to support all the html5 mobile input types.
|
At line 229 simply add...
case (this.element.nodeName.toUpperCase() == 'INPUT' && this.element.type.toUpperCase() == 'NUMBER'):
return LiveValidation.TEXT;
This allows LiveValidation to treat number fields with it's text validation logic. Presence and Numericality work fine.
The text was updated successfully, but these errors were encountered: