Tip 8Validating User Input without JavaScript

When we build web forms, we’re trying to get data from our users and store it or process it and turn it into useful information. Some of the data we ask for might be required, and other bits might be optional. Sometimes that data needs to be in a certain format, and we want to validate the data before we store it so we can give the user a chance to make corrections. Traditionally, developers validate user input in server-side code, because client-side validation techniques with JavaScript can be easily disabled. Server-side validation results in a clumsy, slow user experience because users have to fill in the fields, submit the form, and wait for the whole page to refresh to see what they did wrong. ...

Get HTML5 and CSS3, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.