单选框实现选中不同选项页面变化:
radio
1.html
<table class="m-table m-table-rds" style="width: 100%;margin-top:10px;" align="center">
<tbody>
<tr>
<th style="width:25%;text-align:right;"><span style="color:red;margin:3px;">*</span>单选框切换:</th>
<td style="text-align:left;">
<div style="height: 28px;vertical-align: middle;">
<input type="radio" onclick="showBz(this)" name="projectEditFlag" value="0" checked style="height: 15px;width: 20px;margin-left: 10px"/>第一项
<input type="radio" onclick="showBz(this)" name="projectEditFlag" value="1" style="height: 15px;width: 20px;margin-left: 10px"/>第二项
</div>
</td>
</tr>
</tbody>
</table>
<table id="bzxm" class="m-table m-table-rds" style="width: 100%;margin-top:10px;" align="center">
<tbody>
<tr>
<th style="width:25%;text-align:right;">说明:</th>
<td style="text-align:left;">
九年财富农村妇女和v和吃饭喝发v国防部广泛广泛茶
</td>
</tr>
</tbody>
</table>
<table id="bzbd" class="m-table m-table-rds" style=" display:none;width: 100%;margin-top:10px;" align="center">
<tbody>
<tr>
<th style="width:25%;text-align:right;">备注:</th>
<td style="text-align:left;">
九年财富农村妇女和v和吃饭喝发饭桶饭桶v国防部广泛广泛茶
</td>
</tr>
</tbody>
</table>
2.js
//切换说明
function showBz(obj) {
var proflag = $("input[name='projectEditFlag']:checked").val();
$("#proflag").val(proflag);
if (proflag == '0') {//按项目划分
document.getElementById("bzxm").style.display = "";
document.getElementById("bzbd").style.display = "none";
}
if (proflag == '1') {//按标段划分
document.getElementById("bzxm").style.display = "none";
document.getElementById("bzbd").style.display = "";
}
}
多选
<p style="line-height:26px">
<input name="PATCH_REASON" type="checkbox" value="1" <#if PRE_PATCH?exists&&PRE_PATCH.PATCH_REASON?default('')!=''&&PRE_PATCH.PATCH_REASON?contains("1")>checked="checked"</#if> >《建设项目环境影响评价文件报批申请表》(原件3份、电子版)
</p>
<p style="line-height:26px">
<input name="PATCH_REASON" type="checkbox" value="2" <#if PRE_PATCH?exists&&PRE_PATCH.PATCH_REASON?default('')!=''&&PRE_PATCH.PATCH_REASON?contains("2")>checked="checked"</#if> >建设项目环境影响评价报告书(原件3份、电子版)
</p>
<p style="line-height:26px">
<input name="PATCH_REASON" type="checkbox" value="3" <#if PRE_PATCH?exists&&PRE_PATCH.PATCH_REASON?default('')!=''&&PRE_PATCH.PATCH_REASON?contains("3")>checked="checked"</#if> >建设项目公众参与说明(原件3份、电子版)
</p>
<p style="line-height:26px">
<input name="PATCH_REASON" type="checkbox" value="4" <#if PRE_PATCH?exists&&PRE_PATCH.PATCH_REASON?default('')!=''&&PRE_PATCH.PATCH_REASON?contains("4")>checked="checked"</#if> >对产能过剩行业,需要提交相关部门对建设项目立项批复或备案准予文件
</p>