hi,
Is there any way to make validation rule for multiple Select Box values. i want to allow user to select only four values out of all.
my code is as follow :
in view
echo $form->dropDownList($profile,'major',CHtml::listData(Subjects::model()->findAll(), 'name', 'name'),array('multiple'=>"multiple", 'size'=>"3", 'class'=>'multi'));
in controller i m saving it in comma separated string.
$profile->attributes=$_POST['Profile'];
$profile->major=implode(',',$profile->major);
which rule should I use to compare the total count of array elements return by the select box, and How ?