just some bloke | 18 Dec 07:07
Picon

[FormBuilder] SOLVED Re: Conditional "required =>" possible?



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
just some bloke | 18 Dec 15:10
Picon

Re: [FormBuilder] SOLVED Re: Conditional "required =>" possible?

On 12/18/06, just some bloke <allenjb1 <at> gmail.com> wrote:
>
> 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.
>
>  }
>

I have this working where the Multi based form is 2 pages.

If I try to refer to a form item from the first form from the 3rd
form, it is undef.
How can I access previous pages form items from local forms?

Aj
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers


Gmane