我正在为jQuery
应用程序使用CakePHP
ui标签,当我从类别中选中多个复选框后提交表单时,它会发送空的复选框值,这是我的查看代码;
$j=1;
$question_id = array();
for($i=0; $i<count($naturestab); $i++){
echo '<div id="tabs-'.$j++.'">';
foreach($questionstab as $questiontab){
if($naturestab[$i]['Nature']['id']==$questiontab['Question']['nature_id']){
$question_id = array($questiontab['Question']['id'] => $questiontab['Question']['question'],
);
echo $this->Form->input('questions',array(
'type' => 'select',
'label'=>false,
'multiple' => 'checkbox',
'options'=>$question_id
));
}
}
echo'</div>';
}
答案 0 :(得分:0)
将隐藏字段设为false
echo $this->Form->input('questions',array(
'type' => 'select',
'label'=>false,
'hiddenField'=>false,
'multiple' => 'checkbox',
'options'=>$question_id
));