我在这段代码上已经尝试了很多天,但还没有得到结果。我把列表中的单选按钮放在同一个名字上。当我试图点击按钮时,它没有显示检查标志。这是整个代码
<form>
<ul class="nav nav-pills">
<li class="active choice-option">
<a href="#account" value='1' data-toggle="tab">This is a General Inquiry or you need Assistance
<span class="pull-right">
<!--?= Html::radio('type', true); ?-->
<input type="radio" name="type" class="radio_showed" value='1' checked>
</span>
</a>
</li>
<li class="choice-option">
<a href="#company" data-toggle="tab">You have a Technical Issue and need to open a ticket
<span class="pull-right">
<!--?= Html::radio('type', true); ?-->
<input type="radio" name="type" class="radio_showed" value='1' >
</span>
</a>
</li>
</ul>
</form>
答案 0 :(得分:0)
您需要为单选按钮提供id并为文本添加标签。
尝试以下代码。
<form>
<ul class="nav nav-pills">
<li class="active choice-option">
<a href="#account" value='1' data-toggle="tab"><label for="radio1">This is a General Inquiry or you need Assistance</label>
<span class="pull-right">
<!--?= Html::radio('type', true); ?-->
<input type="radio" name="type" class="radio_showed" value='1' id="radio1" checked>
</span>
</a>
</li>
<li class="choice-option">
<a href="#company" data-toggle="tab"><label for="radio2">You have a Technical Issue and need to open a ticket</label>
<span class="pull-right">
<!--?= Html::radio('type', true); ?-->
<input type="radio" name="type" class="radio_showed" id="radio2" value='1' >
</span>
</a>
</li>
</ul>
</form>
答案 1 :(得分:0)
我认为问题是你的无线电按钮位于锚标记内
<form>
<ul class="nav nav-pills">
<li class="active choice-option">
<a href="#account" value='1' data-toggle="tab">This is a General Inquiry or you need Assistance</a>
<span class="pull-right">
<!--?= Html::radio('type', true); ?-->
<input type="radio" name="type" class="radio_showed" value='1' checked>
</span>
</li>
<li class="choice-option">
<a href="#company" data-toggle="tab">You have a Technical Issue and need to open a ticket</a>
<span class="pull-right">
<!--?= Html::radio('type', true); ?-->
<input type="radio" name="type" class="radio_showed" value='1' >
</span>
</li>
</ul>
在这种情况下,单选按钮正在工作,但它会影响您的样式