My code is:
<?php echo $form->dropDownList($recalls,'grade',array('0'=>'Good','1'=>'Bad'), array('prompt'=>'Rate specialist'));?>
<?php echo $form->error($recalls,'grade'); ?>
and rules is:
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
array('name, phone, report, grade', 'required'),
array('phone', 'numerical', 'integerOnly'=>true),
// The following rule is used by search().
// @todo Please remove those attributes that should not be searched.
array('id, name, phone, idm, report, good, bad', 'safe', 'on'=>'search'),
);
}
When I sending data, dropdownlist field show error message ‘Cannot be blank’?