Re: QuickForm - Conditional Validation?
| From: | Justin Patrin | Date: | Sat, 08 Oct 2005 03:00:36 +0000 |
| Subject: | Re: QuickForm - Conditional Validation? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-21277@lists.php.net to get a copy of this message | ||
On 10/7/05, Guy Brom <guybrom@gmail.com> wrote:
> I have the following group:
>
> $elements[0] = &HTML_QuickForm::createElement('select', 'status',
> 'Status:',
> $list);
> $elements[1] = &HTML_QuickForm::createElement('text', 'value',
> 'Value:');
> $form->addGroup($elements, 'double', 'Double Trouble',
> ' ');
>
> Is it possible to validate 'value' only if 'status' has been selected
> (i.e. - not empty)?
>
Sure. Use a form rule. It's easy enough to write your own callback.
--
Justin Patrin