0
多选择列表中设置验证我有一个多选择框形式:我怎样才能在CakePHP中
echo $this->Form->input('emp_id', array( 'options' => array($arr),
'empty' => '(choose one)',
'div'=>'formfield',
'error' => array( 'wrap' => 'div',
'class' => 'formerror'
),
'label' => 'Team Members',
'type' => 'select', 'multiple' => true,
'style' => 'width:210px; height:125px;'
));
我选择从该列表框中多个值,然后单击SAVE
按钮。
但它显示验证消息。
我该如何解决这个问题?
class TravancoDSRGroup extends AppModel {
var $name = 'TravancoDSRGroup';
var $useTable = 'dsr_group'; // This model uses a database table 'exmp'
var $validate = array(
'emp_id' => array(
'rule' => 'notEmpty',
'message' => 'The employee field is required'
)
);
}
这是在型号代码....
如果可能的话...?