I want to validate a check box but it doesn’t works for me. I tried to use compare, required and boolean validators. Which validator must be used and how?
This check box will be the ‘Agree the Terms and Conditions’. The message when isn’t ticked must be ‘You must agree the Terms and Conditions’.
// form
<?php echo $form->checkBox($signup, 'accept');?>
// model rules
array('accept', 'compare', 'compareValue' => 1, 'message' => 'You should accept term to use our service'),
Not sure that is best way. I think ‘require’ validator should work too