Checkbox validate

Hi, is have a checkbox field.

	<div class="row">

		<?php echo $form->labelEx($model,'nyelvtudas'); ?>

		<?php echo $form->checkBoxList(



                            array('angol'=>'angol', 'német'=>'német', 'francia'=>'francia', 'spanyol'=>'spanyol', 'orosz'=>'orosz'),

                            array('separator'=> ' ', 'template'=> '{input} {label}')

                        ); ?>

		<?php echo $form->error($model,'nyelvtudas'); ?>


My rule:

array('nyelvtudas', 'length', 'max'=>250),

This drop always php error. How to validate this?



I’m not sure what you trying to acomplish but that rule does not allow the value of nyelvtudas to be longer than 250 characters. The error you are getting is because the checklist is returned as a array instead of a single value.

Yes as you say. :)