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



Reply via email to