Client-Side Form Validation

Form validation is one of the most common JavaScripting tasks. Many Web applications need to gather input from users. Traditionally, this data is entered in the browser and then transmitted to the server. The server checks the validity of the data and either stores the data on the server or sends back a message requesting additional information or asking the user to enter valid data. This slows your Web server and creates unnecessary Web traffic. With just a few lines of code, you can validate much of this data on the client's machine and send it to the server only after it is complete. Of course, you still need to completely validate data on the server as well, because people still use browsers that either don't support ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 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.