I have a form with the following widget and validator:
$this->widgetSchema['num01'] = new sfWidgetFormChoice(array(
'choices' => Doctrine_Core::getTable('ticket')->getTicketnum(),
'expanded' => true, 'multiple' => true,
));
$this->validatorSchema['num01'] = new sfValidatorChoice(array(
'choices' =>
array_keys(Doctrine_Core::getTable('ticket')->getTicketnum()), 'required' => true, 'multiple' => true,
));
The problem that I’m having is that it displays 20 checkboxes and I would like to make them select only 5 of them. No more and no less. It has to be exactly 5 boxes checked. How can I customize my code to make this validate that way? Thanks
I tried this just to see if it would work and it did. 🙂