BootStrap复选框“已选中”,并且总是返回FALSE
本文关键字:FALSE 返回 复选框 已选中 BootStrap | 更新日期: 2023-09-27 18:08:31
我在这个问题上需要帮助,我做了几天的复选框,甚至我检查了复选框要知道在c#中每次返回false是真还是假,请检查下面的代码。请帮忙
<<p> 引导代码/strong><form class="form-horizontal" role="form">
<div class="checkbox checkbox-primary">
<input runat="server" id="checkStar" type="checkbox" data-provide="checkbox" />
<label for="checkbox2">Saturday</label>
</div>
<div class="checkbox checkbox-primary">
<input runat="server" id="checkSun" type="checkbox"/>
<label for="checkbox2">Sunday</label>
</div>
<div class="checkbox checkbox-primary">
<input runat="server" id="checkmon" type="checkbox" />
<label for="checkbox2">monday</label>
</div>
<div class="checkbox checkbox-primary">
<input runat="server" id="chectu" type="checkbox"/>
<label for="checkbox2">tuesday</label>
</div>
<div class="checkbox checkbox-primary">
<input runat="server" id="checwe" type="checkbox"/>
<label for="checkbox2">thursday</label>
</div>
</form>
c#代码
if (checkStar.Checked == false & checkmon.Checked == false & chectu.Checked == false & checwe.Checked == false)
{
textbox1.text="please select one day";
retuern;
}
Try
if (!checkStar.Checked && !checkmon.Checked && !chectu.Checked && !checwe.Checked)
{
textbox1.text="please select one day";
return
}