lukeurtnowski — 2012-11-15T16:51:24-05:00 — #1
Is form validation obsolete new the HTML5 came out with the use of the new pattern attribute and the required attribute?
stevie_d — 2012-11-15T18:00:21-05:00 — #2
As there are still a lot of web browsers out there that don't support these features, form validation is still alive and well! Hopefully in time, as these dinosaur browsers wither and die, we will reach a stage where we can ignore server-side validation for most forms. Of course, we may still need to use some server-side validation to prevent malicious use of the form, as relying on client-side validation means that it would be possible for people to circumvent it if they were so minded, so we will never be able to guarantee that client-side validation will work 100%.
stomme_poes — 2012-11-16T17:19:52-05:00 — #3
Also the error messages, especially with pattern, are very limited. You'll want to write better ones than what the browser comes up with
stevie_d — 2012-11-17T06:07:51-05:00 — #4
Except that you should be making it clear before people type anything what the requirements of the field are, so they shouldn't have to wait for the error message to tell them what they've done wrong!
stomme_poes — 2012-11-17T09:53:55-05:00 — #5
Well and have you seen the error messages for pattern? They don't tell you what you did wrong!
I waver between placeholder-like things for patterns versus an aria-describedby linked p with further explanation. Sometimes it can fit in the label (dd-mm-yyyy) but other times not.
dresden_phoenix — 2012-11-18T22:29:55-05:00 — #6
Not is ever obsolete, per say. Form validation is EASIER IN HTML5.. but can you be sure every visitor is using an HTML5 capable browser?? So what about those who arent?
Going back to the HTML5, it's really easy to customize the validation functions ( but yeah, it requires some simple .js and a a HTML5 capable browser)
stomme_poes — 2012-11-19T01:22:13-05:00 — #7
It requires JS anyway... so might as well have full control and use JS entirely.
In the end it's only there for one reason: help push users into filling out the right information in the right format in the right field the first time. Back-end validation does the real validation anyways.