backbone-forms
backbone-forms copied to clipboard
HTML5 validation for the input control
Numeric input control can be invalid (for example<input type=number>
with 123....456 text).
but validation mechanism returns OK.
It uses this.$el.val()
which returns empty for invalid control. As a result all validators passed (except required validator). So for optional fields form will be always committed to server with incorrect input.
Maybe need to add some checking to verify control state?
something like:
this.$el.is(':invalid')
This seems more like a roadmap thing to consider - making validation work with HTML5 elements. We should probably discuss this @exussum12 @powmedia ?
Agreed, The support for these elements is pretty small currently. This should be supported though as the usage will rise
I've been using HTML5 validation more and more, it could be a good idea to at least use the same API and polyfill where required? Could use existing libraries for that.
On Fri, Apr 29, 2016 at 7:59 PM Scott Dutton [email protected] wrote:
Agreed, The support for these elements is pretty small currently. This should be supported though as the usage will rise
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/powmedia/backbone-forms/issues/499#issuecomment-215848778
The support is actually very good these days (94% global support): http://caniuse.com/#search=validation
+1 for having an optional polyfill for the remaining browsers