18 Dec 07:07
[FormBuilder] SOLVED Re: Conditional "required =>" possible?
just some bloke <allenjb1 <at> gmail.com>
2006-12-18 06:07:31 GMT
2006-12-18 06:07:31 GMT
On 12/8/06, not your business <allenjb1 <at> gmail.com> wrote:
Hi there
I am a newbie with Formbuilder, It is FANTASTIC - Good work
anyway
I have a rather large form, and fields farther down the form may depend on what the value of the field above it is.
ie:
Do you own a car? [ Yes/No ]
if Yes, then I want to make the following 5 fields, which are dependant on the first field, become Required, otherwise I do not want to have them even show up (if possible)
Is there a simple way to do this?
if not, how are people doing it?
The secret lies hidden in the man page for FomBuilder::Multi located at http://www.formbuilder.org/download/CGI-FormBuilder-3.0401/docs/CGI/FormBuilder/Multi.html
- what it shows is...
if ($multi->page == 3) {
$form->field(name => 'same_as_billing',
type => 'checkbox',
options => 'Yes',
jsclick => 'this.form.submit()');
Which, by doing a required=>1 or required=>0 in this routine for each page, based on results from previous pages, we can make further fields required.
}
_______________________________________________ FBusers mailing list FBusers <at> formbuilder.org http://www.formbuilder.org/mailman/listinfo/fbusers
RSS Feed