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

Reply via email to