RE: [PEAR] Quick Form, Validation rules and submit
| From: | Mike Carter | Date: | Tue, 07 Oct 2003 09:22:26 +0000 |
| Subject: | RE: [PEAR] Quick Form, Validation rules and submit | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8316@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Alain Sturzenegger [mailto:alain.sturzenegger@eyepmedia.com]
>
> Hi,
>
> I have a question regarding Quick Form.
> I have some fields with rules and it was working great till
> I've set in the QuickForm
> constructor the action.
> Now when I click on my submit button, the fields are no more
> checked. How can I have both behaviour e.g. check the fields
> on the form and when they
> are correctly filled go on an other URL in order to proceed my data ?
It depends if your validation rules are client (javascript) or server
(PHP) side.
If they are server side then the validation only takes place when the
'submit' button of your form is pressed.
The validation occurs when $form->validate(); is called.
Adding an action attribute to point to another PHP script would by-pass
this validation, thus giving you the problem you have.
Another post recently on the PEAR list discussed the best way to move on
to the next page of a form/website after validation in a Quickform.
Basically use a header(), after calling validate() but before doing any
form display.
Regards,
Mike C.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________