Solved - this works:
'rule' => array('equalTo', '1'),
...oddly enough.
Jeremy Burns
Class Outfit
[email protected]
(t) +44 (0) 208 123 3822
(m) +44 (0) 7973 481949
Skype: jeremy_burns
http://www.classoutfit.com
On 28 Dec 2010, at 17:11, Jeremy Burns wrote:
> I have a checkbox that users must tick to show they agree to the terms and
> conditions. I am using this validation rule:
>
> 'agree_terms' => array(
> 'rule' => array('equalTo', true),
> 'message' => 'You must indicate that you agree to the terms and
> conditions of use.'
> )
>
> I have also tried:
> 'rule' => array('equalTo', 1),
>
> By placing debug statements in /cake/libs/validation.php I can see that
> $check equals 1 and $comparedTo equals 1, yet the rule always fails:
>
> function equalTo($check, $comparedTo) {
> debug($check);
> debug($comparedTo);
> if ($check === $comparedTo):
> die(debug('Yes'));
> else:
> die(debug('No'));
> endif;
> return ($check === $comparedTo);
>
>
> This always returns false, which means validation is failing. Anyone got any
> tips?
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected] For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en