更具后台返回值判断多选框、单选框是否选中

js代码:

<script type="text/javascript">
  $(function(){
    var a = "${ps.passagetype}";//运营商
     $("input[name='passagetype']").get(a-1).checked= true;
    var a = "${ps.pasIsSpPerfix}";//sp字冠支持 
     $("input[name='pasIsSpPerfix']").get(a-1).checked= true;
    if("${ps.pasIsSpExpend}"=='1'){
     $("#pasIsSpExpend").attr("checked",true);
    }if("${ps.pasIsSpLm}"=='1'){
     $("#pasIsSpLm").attr("checked",true);
    }if("${ps.pasStatus}"=='1'){
     $("#pasStatus").attr("checked",true);
    }if("${ps.pasIsDiy}"=='1'){
     $("#pasIsDiy").attr("checked",true);
    }if("${ps.pasIsLocalPro}"=='1'){
     $("#pasIsLocalPro").attr("checked",true);
    }if("${ps.pasCheck}"=='1'){
     $("#pasCheck").attr("checked",true);
    }if("${ps.pasIsSpPerfix}"=='1'){
     $("#pasIsSpPerfix").attr("checked",true);
    }if("${ps.pasIsConsum}"=='1'){
     $("#pasIsConsum").attr("checked",true);
    }
  });
 </script>

jsp代码:

<div class="subbg">
    <input type="radio" name="passagetype" id="passagetype" checked="checked" value="1"/><label>本省移动</label>
    <input type="radio" name="passagetype" id="passagetype" value="2"/><label>本省联通</label>
    <input type="radio" name="passagetype" id="passagetype" value="3"/><label>本省电信</label>
    <input type="radio" name="passagetype" id="passagetype" value="4"/><label>全国移动</label>
    <input type="radio" name="passagetype" id="passagetype" value="5"/><label>全国联通</label>
    <input type="radio" name="passagetype" id="passagetype" value="6"/><label>全国电信</label>
    <input type="radio" name="passagetype" id="passagetype" value="7"/><label>全能通道</label>
    </div>

<div class="subbg">
    扩展支持<input type="checkbox" name="pasIsSpExpend" id="pasIsSpExpend" value="true"/>
    超长短信<input type="checkbox" name="pasIsSpLm"  id="pasIsSpLm" value="true"/>
    状态报告<input type="checkbox" name="pasStatus"  id="pasStatus" value="true"/>
    独享通道<input type="checkbox" name="pasIsDiy"  id="pasIsDiy" value="true"/>
    支持回复<input type="checkbox" name="pasIsLocalPro" id="pasIsLocalPro" value="true"/>
    审核<input type="checkbox" name="pasCheck" id="pasCheck" value="true"/>
    </div>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值