What it sounds like you need is a post validator...

http://www.symfony-project.org/forms/1_4/en/02-Form-Validation#chapter_02_global_validators

On Mon, May 16, 2011 at 1:58 PM, codecowboy <l...@lukem.co.uk> wrote:

> Hi,
> I can't find an example of how to add a required checkbox to a form
> which is unrelated to my model e.g a checkbox to accept the terms and
> and conditions for registration.
>
> I think maybe what I need is something like:
>
>    $this->widgetSchema['tsandcs'] = new sfWidgetFormInputCheckbox();
>
>    $this->setValidator('tsandcs', new sfValidatorBoolean());
>
> But how do I force validation so that the form will only validate if
> the checkbox is checked?
>
> Symfony version is 1.4
>
> thanks!
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Gareth McCumskey
http://garethmccumskey.blogspot.com
twitter: @garethmcc
identi.ca: @garethmcc

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to