by quackerhacker · 13y ago · 0 comments
Like what's shown in the article, the main purposes for these new additions is for ui/ux. Devs should still rely on validation scripting prior to a form submission (js) and processing (server side). Although I do know we can implement patterns on the inputs like pattern="[A-Za-z0-9]*" , if your form is submitted with js, it's a good idea to still run some simple validations. (Ex. in chrome, I had a 'required' markup in a hidden input that is suppose to show after a certain field in a form, I encountered form submission problems, even after the area was visible.)
On a side note...I didn't know about the url [input=type], thanks for that one :)
Why? Adding redundant code that doesn't solve a problem is always a bad idea.
Not so big a deal on one field, but if you have 5+ errors in a long form, it can add up.
You of course still have to validate server-side to stop ancient browsers or people trying to hack your site from submitting bad data.
Another quirk about form validation in HTML5 is the forms won't get validated UNTIL the user submits the form and then the browser may highlight the error in consecutive order (1 at a time o_O), imagine your poor UX for a user that has multiple errors.
[0] http://www.w3schools.com/HTML/html5_form_input_types.asp