[PHP] Re: Form validation: client- or server-side?

2004-01-09 Thread Manuel Lemos
Hello,

On 01/09/2004 04:07 PM, Matt Grimm wrote:
Is there a distinct advantage to doing form validation / error checking on
the server side using PHP?  That's how I've always done it because I know
PHP better than JavaScript, but wouldn't it make sense to validate as much
of your form as possible using JavaScript before the form was ever posted?
I'm just talking about the basics, like empty required fields, illegal
characters, string lengths, etc.
What are your preferred methods?  I do an awful lot of content management
with HTML forms, so it's not an entirely spurious question.
Server side validation is mandatory. However, whenever possible you 
should perform client side validation to make your forms more usable as 
the users do not have to wait for the server to process the submitted 
form to tell the user about invalid fields, if with some client side 
validation that feedback can be antecipated.

You may want to take a look and this popular forms generation and 
validation class that not only can perform many built-in supported types 
both client side and server side validation, as it can preform some 
pre-processing of values like capitalization of text values, 
auto-completion or reformatting based on rules define with regular 
expressions also with support to perform that on client and server side. 
Take a look at the examples:

http://www.phpclasses.org/formsgeneration

--

Regards,
Manuel Lemos
Free ready to use OOP components written in PHP
http://www.phpclasses.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Form validation: client- or server-side?

2004-01-09 Thread Matt Grimm
Thanks for the great input guys.  Sounds like I'm using a sound method now
with full server-side validation.  Perhaps to make the most user- and
server-friendly forms, one could use JavaScript as a guide to the user,
alerting them to erroneous input and suggesting alternatives rather than
being relied upon for more serious validation.

--
Matt Grimm


Matt Grimm [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Is there a distinct advantage to doing form validation / error checking on
 the server side using PHP?  That's how I've always done it because I know
 PHP better than JavaScript, but wouldn't it make sense to validate as much
 of your form as possible using JavaScript before the form was ever posted?
 I'm just talking about the basics, like empty required fields, illegal
 characters, string lengths, etc.

 What are your preferred methods?  I do an awful lot of content management
 with HTML forms, so it's not an entirely spurious question.

 --
 Matt Grimm
 Web Developer
 The Health TV Channel, Inc.
 (a non - profit organization)
 3820 Lake Otis Parkway
 Anchorage, AK 99508
 907.770.6200 ext. 686
 907.336.6205 (fax)
 E-mail: [EMAIL PROTECTED]
 Web: www.healthtvchannel.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php