关于input中type="radio"的判断问题,查看选中项

<div class="panel panel-default" style="width: 50%;height: 60px;float: left;margin-bottom: 0px;">
    <div class="panel-heading" style="height: 25px; width: 100%;line-height: 12px; border-top: 1px solid whitesmoke; margin-bottom: 0px; padding-left: 0px">
        <div class="searcher_1" style="float: left"><span class="glyphicon glyphicon-tree-deciduous"></span></div>
        <div style="float: left; width: 80%; height: 100%; ">
            <p>是否为********</p>
        </div>
    </div>
    <div class="select_1 panel-body" style="padding: 0px;margin: 0px; width: 100%" >
        <input type="radio" name="ARadio"  value="yes" />是
        <input type="radio" name="ARadio"  value="not" />否
    </div>
</div>

 在这里我们给input 标签两个value,为后来判断用户选择打下基础

//*********判断
var ATF=$('input:radio[name="ARadio"]:checked').val();
var A;
if(ATF==="yes"){
    ATF=" and a = '是' ";
}
else if(ATF==="not"){
    A=" and a is Null";//SQL中判断为空的语句***
}
else {
    A="";
}

通过这几行js代码进行判断用户选择的是“是”还是“否” 

猜你喜欢

转载自blog.csdn.net/True_Rain/article/details/84479645
今日推荐