On Fri, 13 Jul 2001, John Edwards wrote:

> I would do this using Javascript in the form.
>
> The advantage of this is the form data is validated without the client
> having to return the form to the server, which then would have to validate
> and return the the client the errors. With JS you can do it all client-side
> and only allow the form to be submitted once it's passed validation.

I think it's still a good idea to do form validation on the server side
also -- the client might have JavaScript turned off, for instance.  Then
you've got both bases covered.

For CGI.pm, I will go through the steps to validate the data, and if
anything is bad, I will save the form data onto disk (using the method
that CGI has for saving a copy of itself), then redirect back to the
original form, with an error message, and reloading the CGI object from
disk so the data the user entered is already entered and they need only
correct the bad data.

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
In most instances, all an argument proves is that two people are present.

Reply via email to