Re: validating forms without Javascript

by Jim Tom Polk <jtpolk(at)texas.net>

 Date:  29 Mar 2002 00:13:07 -0600
 To:  "hwg-basics(at)mail.hwg.org" <hwg-basics(at)mail.hwg.org>
  todo: View Thread, Original
>>>>>
The reason I believe JavaScript to be the most useful for form
validation is that it is a client-side scripting language, so the form
is validated before it is ever sent to the server, which is good if your
server is going to be running these forms quite often.
<<<<

This is one area where JavaScript can really shine. Without the user
having to submit the form, and have something like PHP or CGI/Perl
program validate the input, you can have a greater degree of customer
service by having the JavaScript validate as they go along, giving them
prompts and the like.

The real key is to have PHP or CGI/Perl server side validation occur as
well, but to serve the customer by informing them of problems with the
way they are filling out the form before submission to the server. It is
a pain to have a long form and then to do a submit, then have to read
the error message, then have to look through the form for the problem.

The nice thing is that it works as well with JavaScript in the client's
browser turned off.

Finally, I believe that when you build a server side application, like a
form that will insert information into a database or the like, a good
web programmer will always have the application on the server validate
the input, i.e., if it is important then the server application should
never trust the information that is being sent to it, and must always
validate the important parts of the input.

The last is just my philosophy have spent years doing this sort of
stuff.

-- 


Jim Tom Polk -:- jtpolk(at)texas.net -:- http://camalott.com/~jtpolk/	
	''You might as well fall flat on your face as 
	  lean over too far backwards.''      --James Thurber--
   "The Universe is run by the complex interweaving of three 
          elements: energy, matter and enlightened self-interest." 
 		- G'Kar  "Survivors"                                  

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA