【发布时间】:2020-06-18 14:00:31
【问题描述】:
我有一组单选按钮(是或否),值从数据库呈现为 boolean ,如果 db 值为 true 则将单选按钮设置为选中 else no。而且现在当我点击是时,是和否都被选中了。
下面是我的代码:
<div class="col-md-3">
<div class="form-group form-group--float">
<div class="radio">
<input type="radio" name="sp" id="customRadio1" asp-for="SPLimit" value="1" >
<label class="radio__label" for="customRadio1">Yes</label>
<input type="radio" name="sp" id="customRadio2" asp-for="SPLimit" value="0">
<label class="radio__label" for="customRadio2">No</label>
</div>
</div>
</div>
【问题讨论】:
标签: asp.net-mvc twitter-bootstrap asp.net-core