更具后台返回值判断多选框、单选框是否选中
来源:互联网 发布:网络中继器设置方法 编辑:程序博客网 时间:2024/06/05 03:07
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>
- 更具后台返回值判断多选框、单选框是否选中
- jsp 接收后台返回数据判断CheckBox是否选中 简单例子只需一句代码
- 判断多选框是否选中
- 判断单选框是否选中
- 判断多选框是否被选中
- 判断单选框是否被选中
- javascript判断单选框是否选中
- Jquery 判断 checkbox是否选中 返回 undefined 问题
- JS 判断单选框(radio)是否被选中
- jQuery判断单选框是否被选中
- jQuery判断单选框是否被选中
- JQuery判断radio单选框是否选中
- 判断checkbox是否选中并获取值
- 判断checkbox是否选中
- 判断是否选中radion
- 判断checkbox是否选中
- 判断checkBox是否选中
- jQuery 判断是否选中
- 读取连接字符串
- Android导入工程提示Invalid project description错误
- windows下修改hosts文件,添加固定的DNS解析
- C操作MYSQL
- 那时,我们正年轻
- 更具后台返回值判断多选框、单选框是否选中
- Linux安装文件
- NSLogger 日志工具
- 2012.09.24京东笔试
- innerHTML简单用法
- IOCP
- Openwrt编译生成虚拟机镜像
- ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
- 常用 无线路由的地址、用户名 、密码