During client-side form validation certain parts can be validated using html(using the required or type attribute in <input>). I can achive those same things using js. So, what parts of the form validation should be done in js and what parts can be left for html? Which one is more safe?
-
2This questions is a little too broad for StackOverflow. Do you have a specific problem you're having? It may be a better fit for programmers.stackexchange.comRuan Mendes– Ruan Mendes2014-12-29 18:27:08 +00:00Commented Dec 29, 2014 at 18:27
-
HTML5 input validation does not cover the size or types of input files. See a related SO question for further info.J0e3gan– J0e3gan2014-12-29 18:29:02 +00:00Commented Dec 29, 2014 at 18:29
-
the maxlength attribute in input tag?SouvikMaji– SouvikMaji2014-12-29 18:30:30 +00:00Commented Dec 29, 2014 at 18:30
Add a comment
|
1 Answer
HTML5 validation is convenient but it depends on your audience. HTML5 validations are not supported by some older browsers (here is the list: http://caniuse.com/#feat=form-validation). Also I've noticed a Safari bug: the form doesn't validate (expected behavior) but the pop up error message doesn't display leaving the user unsure of the issue.