cakephp: remove stars in all choices in a radio button

谁都会走 提交于 2019-12-02 01:30:56

Have an attribute called legend with a name to group all radio

echo $form->input('Users.vote', array(
 'type' => 'radio',
 'legend' => 'Vote*',
 'class' => 'vote',
 'options' => array('1' => 'a', '2' => 'b', '3' => 'c' ),
));

I don't prefer using legends so I added a label before the radio list:

<?php echo $this->Form->label('radioname', __('Label:', true), 'required'); ?>

Then adjusted the css for the new label and the radio button labels:

label.required:after {
  color: #e32;
  content: '*';
  display:inline;
}

.radio label{
  font-weight:normal;
}
.radio label:after{
  display:none !important;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!