O'Reilly logo

Accelerated DOM Scripting with Ajax, APIs, and Libraries by Dan Webb, Stuart Langridge, Aaron Gustafson, Jonathan Snook

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 7Form Validation and JavaScript

By Stuart Langridge

Most web applications use the <form> tag at one place or another. If your app uses a <form> to gather information, you'll probably want to try and validate that information to make sure that what the user is filling in is reasonable in some way. Hence the convention that an * next to a bit of a form means "this part is mandatory; you must fill it in." It's equally important that if you want the information you receive to be in a certain format you have your app enforce that format. This is what validation is all about: having your app check what the user types to confirm that it's what you were expecting. If you're asking users for the number of chickens they own, it's a good idea to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required