Re: QuickForm - Building Validation Rules
| From: | Bertrand Mansion | Date: | Thu, 31 Jul 2003 06:44:01 +0000 |
| Subject: | Re: QuickForm - Building Validation Rules | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6925@lists.php.net to get a copy of this message | ||
<barry@hpfm.biz> wrote :
> Hi,
> Is it possible to build a rule for group such as
>
> if group[$x]->getSubmitValue()
> {
> group[$$x.'Expl']->setRequired() /* or similar*/
> }
>
> Essentially I have a range of radio button and checkbox groups some of
> the elements of which have an associated explanation field that is
> required if the user decided to pick that specific choice.
>
> THese options are set in a reference table and the element groups are
> builtfrom these reference tables. I want to ensure that if the user
> selects specific options form the checkboxes (multiple), or radio
> buttons (single choice) they are required to enter an explanation.
Validation stuff is here:
http://pear.php.net/manual/en/package.html.html-quickform.intro-validation.p
hp
What you suggest is easily feasible, just create your custom rule as a
function.
Bertrand Mansion
Mamasam