I am trying to validate multiple checkboxes of a HABTM table. I managed to
validate the values but cannot get a message to display. I have my own
compare values in db against submitted data to validate but no message
appears....
 
I then see in the cookbook 
 
var $validate = array(
          'function' => array(
                'allowedChoice' => array(
                        'rule' => array('inList', array('Foo', 'Bar')),
                        'message' => 'Enter either Foo or Bar.'
                )
          )
        );

and
 
var $validate = array(
    'multiple' => array(
        'rule' => array('multiple', array('in' => array('foo', 'bar'), 'min'
=> 1, 'max' => 3)),
        'message' => 'Please select one, two or three options'
    )
);

Would either of these work for validating multiple checkboxes? 
And how do I get the values of the fields when they say
'rule' => array('inList', array('Foo', 'Bar')),

Or 

'rule' => array('multiple', array('in' => array('foo', 'bar'), 'min' => 1,
'max' => 3)),

Thanks,

 
Dave


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

Reply via email to