You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Phillip Rhodes <rh...@yahoo.com> on 2005/01/19 19:57:58 UTC

make required conditional for validfield?

Is there anyway one can control ValidField and make required conditional?

For example, if  check box (bound to page boolean property) is not 
checked, then make these 6 fields required?

Any thoughts.

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: make required conditional for validfield?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 19, 2005, at 2:57 PM, Erik Hatcher wrote:
>
> On Jan 19, 2005, at 1:57 PM, Phillip Rhodes wrote:
>
>> Is there anyway one can control ValidField and make required 
>> conditional?
>>
>> For example, if  check box (bound to page boolean property) is not 
>> checked, then make these 6 fields required?
>>
>> Any thoughts.
>
> yes - simply make the required expression on your validator be dynamic 
> rather than static.  look at the workbench demo app and how it toggles 
> the client-side validation on and off - same dealio.

Though turning off validation with a checkbox in the same form as the 
fields may be tricky.... the checkbox probably needs to come physically 
(in the template) before the other fields.  Notice how the Workbench 
checkbox submits the form when changed automatically.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: make required conditional for validfield?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Jan 19, 2005, at 1:57 PM, Phillip Rhodes wrote:

> Is there anyway one can control ValidField and make required 
> conditional?
>
> For example, if  check box (bound to page boolean property) is not 
> checked, then make these 6 fields required?
>
> Any thoughts.

yes - simply make the required expression on your validator be dynamic 
rather than static.  look at the workbench demo app and how it toggles 
the client-side validation on and off - same dealio.

	Erik



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org