Re: QuickForm - Required if
| From: | Ben Ford | Date: | Fri, 17 Sep 2004 22:14:05 +0000 |
| Subject: | Re: QuickForm - Required if | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14556@lists.php.net to get a copy of this message | ||
Hi,
I would use HTML_QuickForm_Controller to create the form. QFC creates multipage forms that allow you to skip or jump around the different form pages.
This would allow you to change what form elements get shown, depending on user input.
The archive has 5 great examples of it's capabilities...
Sagi Bashari wrote:
Hi, I'm trying to create a form using HTML_QuickForm. The form includes few elements that may be required, but only if another element, eg. a checkbox is active. I thought about few ways to do it, like only registering these rules on submit after manually checking if the other field is active, or using a FormRule. However both ways I'll have to give up some features like client side validation and/or denoting the field as required (unless I do it manually). Is there a cleaner way to do this? Maybe extending Rule_Required in some way? Sagi