Re: Re: QF rules as notices
| From: | Bertrand Mansion | Date: | Thu, 22 Apr 2004 09:21:01 +0000 |
| Subject: | Re: Re: QF rules as notices | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12015@lists.php.net to get a copy of this message | ||
<a.temme@gmx.de> wrote :
>> This can't be done with quickform, rules are not "optional".
>
> Hello Aidan, hello list,
>
> is there really no possibility? I thought about different ways how this
> could be done:
>
> a) Additional parameters for addRule(). If I do print_r($form), the array
> _rules shows some keys which seem not to be used or which could be supplied
> with a further value to keep track of notices?
>
> b) To validate the form I use
> if ($form->validate())
> {
> $form->process('process_data', false);
> return;
> }
> Maybe at this point sth. could be added so that notices don't return false
> for $form->validate(), maybe with an additional parameter to validate()?
>
> c) The documentation says:
> "Since release 3.2 all builtin validation is performed by subclasses of
> HTML_QuickForm_Rule class. You can create your own subclass of it and
> implement validate() and getValidationScript() methods."
> Maybe this would be the proper way to fulfill my needs?
>
> Any other suggestions?
If I understood correctly, you want to have a confirmation message before
the user submits ? If this is it, you can create your own javascript in a
confirm() function and call it using the onclick event of a button. If you
don't want javascript, you can use the controller and tweak the 'next'
action to have it display a confirmation form:
Page1 -- submit --> Page1 (frozen + notice message) --> confirm or back
Rules won't help you here as they are meant to validate user data by
returning 'true' or 'false', not 'perhaps'.
Bertrand Mansion
Mamasam