Mark Hedges | 6 Dec 19:53
Favicon

Re: [FormBuilder] Validate option

> 
> I want to use a hashref for a validate option so I can set different  
> validation for javascript and perl. It's more convenient for me to  
> apply this via the field method rather than the new method. The  
> documentation implies that the field method only really supports a  
> standard regex but I've found that a hashref works just fine too. So,  
> the question is:  is there any reason I should not use a hasref for  
> the validate option of the field method?
> 

That worked fine for me, but if you do it in pieces after some 
logic, you have to get the value first, add to that hash, then 
assign back.

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

Guy Parker | 7 Dec 12:06
Picon

Re: [FormBuilder] Validate option


>>
>> I want to use a hashref for a validate option so I can set different
>> validation for javascript and perl. It's more convenient for me to
>> apply this via the field method rather than the new method. The
>> documentation implies that the field method only really supports a
>> standard regex but I've found that a hashref works just fine too. So,
>> the question is:  is there any reason I should not use a hasref for
>> the validate option of the field method?
>>
>
> That worked fine for me, but if you do it in pieces after some
> logic, you have to get the value first, add to that hash, then
> assign back.

Thanks Mark. I'm not sure I follow what you mean exactly. Could you  
expand just a little?

Guy

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

not your business | 8 Dec 11:26
Picon

[FormBuilder] Conditional "required =>" possible?

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?


if it is covered anyware, i have looked most of this afternoon without finding it, maybe you could point me to it?

thanks

_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
Nate Wiger | 8 Dec 20:55
Picon
Gravatar

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

Glad you like FormBuilder - there are two issues here

1) Conditional validation: You could use a sub ref, or check out
Data::FormValidator, which is supported by FormBuilder. It supports
conditional validation.

2) Not making them appear: This is a client browser issue, so you'll
have to use "jsclick" and point it to an group of fields to hide. What
I would do is wrap them in a fieldset, give that its own id, then use
display:none via CSS to hide that dynamically. Check out jquery.com
for its functions, specifically "toggle" and "show/hide" that will
save you alot of work.

-Nate

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?
>
>
> if it is covered anyware, i have looked most of this afternoon without
> finding it, maybe you could point me to it?
>
> thanks
>
> _______________________________________________
> FBusers mailing list
> FBusers <at> formbuilder.org
> http://www.formbuilder.org/mailman/listinfo/fbusers
>
>
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

not your business | 8 Dec 23:03
Picon

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

On 12/9/06, Nate Wiger <nwiger <at> gmail.com> wrote:

Glad you like FormBuilder - there are two issues here

1) Conditional validation: You could use a sub ref, or check out
Data::FormValidator, which is supported by FormBuilder. It supports
conditional validation.

You say Conditional Validation here.... - Just to help my 6am , pre coffee brain let me verify....
So this will help me to do Conditional requires? -

ie: Only require field COLOUR if CAR=YES
OR to say it another way
     I dont care about the Colour field if CAR is NO, however if CAR is YES, then COLOR absolutely MUST to be filled in.

I suspect that because the field definition is done before the script runs, I might have to create multiple forms (without FormBuilder::Multi) which start at the top - ie asking all the Conditions on the First Page, and then based on those, send back the form they need?
eg:
page 1 asks

Do you have a car?
Do you have a bike?
Do you have a ball of string?
How Many Children do you have?

and then based on those answers, send back a form which asks the next lot of questions.

ie: Color of car
     Color of Bike
     Length of string
     and 6 fields for the ages of the 6 children. (this one not so important)

I could not find anything in your EXCELLENT documentation which describes the best way to do this. I would prefer to allow Formbuilder to do it's work in keeping track of stuff as it does in FB::multi, than  reinventing the wheel


2) Not making them appear: This is a client browser issue, so you'll
have to use "jsclick" and point it to an group of fields to hide. What
I would do is wrap them in a fieldset, give that its own id, then use
display:none via CSS to hide that dynamically. Check out jquery.com
for its functions, specifically "toggle" and "show/hide" that will
save you alot of work.


This looks simple enough if I could just get point 1 working.

thanks again for one of the best documented perl modules i have ever seen!!!
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
not your business | 8 Dec 23:08
Picon

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

move along, nothing to see here -

found the dependancies section in DATA::FormValidator

- must remember caffeine b4 emailing...

Aj

On 12/9/06, not your business <allenjb1 <at> gmail.com> wrote:
On 12/9/06, Nate Wiger <nwiger <at> gmail.com> wrote:
Glad you like FormBuilder - there are two issues here

1) Conditional validation: You could use a sub ref, or check out
Data::FormValidator, which is supported by FormBuilder. It supports
conditional validation.

You say Conditional Validation here.... - Just to help my 6am , pre coffee brain let me verify....
So this will help me to do Conditional requires? -

ie: Only require field COLOUR if CAR=YES
OR to say it another way
     I dont care about the Colour field if CAR is NO, however if CAR is YES, then COLOR absolutely MUST to be filled in.

I suspect that because the field definition is done before the script runs, I might have to create multiple forms (without FormBuilder::Multi) which start at the top - ie asking all the Conditions on the First Page, and then based on those, send back the form they need?
eg:
page 1 asks

Do you have a car?
Do you have a bike?
Do you have a ball of string?
How Many Children do you have?

and then based on those answers, send back a form which asks the next lot of questions.

ie: Color of car
     Color of Bike
     Length of string
     and 6 fields for the ages of the 6 children. (this one not so important)

I could not find anything in your EXCELLENT documentation which describes the best way to do this. I would prefer to allow Formbuilder to do it's work in keeping track of stuff as it does in FB::multi, than  reinventing the wheel


2) Not making them appear: This is a client browser issue, so you'll
have to use "jsclick" and point it to an group of fields to hide. What
I would do is wrap them in a fieldset, give that its own id, then use
display:none via CSS to hide that dynamically. Check out jquery.com
for its functions, specifically "toggle" and "show/hide" that will
save you alot of work.


This looks simple enough if I could just get point 1 working.

thanks again for one of the best documented perl modules i have ever seen!!!

_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
not your business | 8 Dec 23:32
Picon

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

Dude, you have spoilt us with your docs.

again, well done...

On 12/9/06, not your business <allenjb1 <at> gmail.com > wrote:
move along, nothing to see here -

found the dependancies section in DATA::FormValidator

- must remember caffeine b4 emailing...

Aj


On 12/9/06, not your business <allenjb1 <at> gmail.com> wrote:
On 12/9/06, Nate Wiger <nwiger <at> gmail.com> wrote:
Glad you like FormBuilder - there are two issues here

1) Conditional validation: You could use a sub ref, or check out
Data::FormValidator, which is supported by FormBuilder. It supports
conditional validation.

You say Conditional Validation here.... - Just to help my 6am , pre coffee brain let me verify....
So this will help me to do Conditional requires? -

ie: Only require field COLOUR if CAR=YES
OR to say it another way
     I dont care about the Colour field if CAR is NO, however if CAR is YES, then COLOR absolutely MUST to be filled in.

I suspect that because the field definition is done before the script runs, I might have to create multiple forms (without FormBuilder::Multi) which start at the top - ie asking all the Conditions on the First Page, and then based on those, send back the form they need?
eg:
page 1 asks

Do you have a car?
Do you have a bike?
Do you have a ball of string?
How Many Children do you have?

and then based on those answers, send back a form which asks the next lot of questions.

ie: Color of car
     Color of Bike
     Length of string
     and 6 fields for the ages of the 6 children. (this one not so important)

I could not find anything in your EXCELLENT documentation which describes the best way to do this. I would prefer to allow Formbuilder to do it's work in keeping track of stuff as it does in FB::multi, than  reinventing the wheel


2) Not making them appear: This is a client browser issue, so you'll
have to use "jsclick" and point it to an group of fields to hide. What
I would do is wrap them in a fieldset, give that its own id, then use
display:none via CSS to hide that dynamically. Check out jquery.com
for its functions, specifically "toggle" and "show/hide" that will
save you alot of work.


This looks simple enough if I could just get point 1 working.

thanks again for one of the best documented perl modules i have ever seen!!!


_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers
Geoff Simmons | 11 Dec 06:36

[FormBuilder] POD patch for CGI::FormBuilder::Template::TT2

Hi,

Noticed a small error in the documentation for the 'engine' method in
CGI::FormBuilder::Template::TT2.  It actually returns a Template object
(not a HTML::Template object).

I've provided a patch inline.

Geoff

Index: trunk/lib/CGI/FormBuilder/Template/TT2.pm
===================================================================
--- trunk/lib/CGI/FormBuilder/Template/TT2.pm	(revision 89)
+++ trunk/lib/CGI/FormBuilder/Template/TT2.pm	(working copy)
@@ -95,7 +95,7 @@

 =head2 engine

-Returns a reference to the C<HTML::Template> object
+Returns a reference to the C<Template> object

 =head2 prepare

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

Nate Wiger | 11 Dec 08:02
Picon
Gravatar

Re: [FormBuilder] POD patch for CGI::FormBuilder::Template::TT2

Fixed; Text.pm was wrong too. Thanks Geoff.

-Nate

On 12/10/06, Geoff Simmons <gsimmons <at> gsimmons.org> wrote:
> Hi,
>
> Noticed a small error in the documentation for the 'engine' method in
> CGI::FormBuilder::Template::TT2.  It actually returns a Template object
> (not a HTML::Template object).
>
> I've provided a patch inline.
>
> Geoff
_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers

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

Gmane