- Featured Columnists
-
Table of Contents
- Welcome
- Web Basics
- Publishing on the Web: Putting Files on the Server
- Web Design Process and Workflow
- Project Management
- Mark My WWWord: HTML and XHTML
- Standards Compliance
- Layouts
-
Forms
- All About Forms
- Form Elements
- Form Controls
- Post vs. Get
- Forms Validation
- Books and e-Books
- Online Resources
- Meta Tags and Search
- Usability
- Accessibility
- Enhancing Web Page Interaction
- Web Graphics
- Web Page Optimization
- Multimedia
- Content
- Overview of Servers
- Server Programming Basics
- Careers in Web Design
- Tools
- Tutorials
- Intellectual Property for Web Designers
Forms Validation
Last updated Oct 17, 2003.
By Molly Holzschlag
Forms require validation, and this can be done either on the client side or the server side. Validation of forms mostly involves checking that the information a person has input into the form is accurately formed, and that no required fields have been skipped.
Client-side validation is almost always done using (usually) JavaScript. Using JavaScript for forms validation is an easy-to-implement option, and because the validation is done client-side, it can occur rather quickly, improving user experience. On the other hand, if JavaScript is disabled by the user or for some reason unavailable, this technique won't work.
Server-side validation for forms can be achieved with almost every conceivable server-side application language. You can do it with PHP, ASP, .NET, ColdFusion, Perl/CGI, Python/Zope; if you can name an application language used on the Web, it'll have form validation built-in.
So how do you choose? If you want a simple and fast method, I recommend using client-side with JavaScript. If you want a stable, interoperable method, choose an application that will work with your server. Some Web developers advocate using both a client-side option along with a server-side option. If the client doesn't support JavaScript, the server validation steps up to the plate and handles the validation in its stead.
