我的表单中有一个单选按钮,使用以下代码
echo $form->input('Users.vote', array(
'type' => 'radio',
'label' => array('text' => __("form_vote", "true"), 'class' => 'vote'),
'options' => array('1' => 'a', '2' => 'b', '3' => 'c' ),
));
这是我的投票模型验证
'vote' => array(
'rule' => 'inList', array(1,2,3),
'allowEmpty' => false,
'required' => true,
'message' => 'error_vote'
)
问题是它在 a、b 和 c 选项旁边添加了一个 *。这是一个屏幕截图,展示了所有三个选项上都有星星的情况。http://imageshack.us/photo/my-images/23/radiojpg.jpg/我希望星星仅显示在“投票”标签上
这是 html 输出
<div class="input radio required"><fieldset><legend>Vote</legend><input type="hidden" value="" id="UserVote_" name="data[User][vote]">
<input type="radio" value="1" id="UserVote1" name="data[User][vote]">
<label for="UserVote1">a<span class="red">*</span></label>
<input type="radio" value="2" id="UserVote2" name="data[User][vote]">
<label for="UserVote2">b<span class="red">*</span></label>
<input type="radio" value="3" id="UsertVote3" name="data[User][vote]">
<label for="Vote3">c<span class="red">*</span></label></fieldset></div>