在页面上通过JavaScript控制表格的隐藏和显示

 

JavaScript的控制语句

   function selectInjunction() {
    if(document.getElementById("injunctionType").value.trim() == 0) {
     document.all.displaysubcode.style.display = "none";
     document.all.displayinjunction.style.display = "";
    
     document.all.pipeizhengze.style.display = "";
    } else if(document.getElementById("injunctionType").value.trim() == 3) {
     document.all.displaysubcode.style.display = "";
     document.all.displayinjunction.style.display = "none";
    
     document.all.pipeizhengze.style.display = "";
     
    } else if(document.getElementById("injunctionType").value.trim() == 4) {
     document.all.displaysubcode.style.display = "";
     document.all.displayinjunction.style.display = "";
    
     document.all.pipeizhengze.style.display = "none";
    } else if(document.getElementById("injunctionType").value.trim() == 7) {
     document.all.displaysubcode.style.display = "none";
     document.all.displayinjunction.style.display = "none";
     document.all.pipeizhengze.style.display = "none";
    }
   }

 

页面上的触发事件

  <td width=45% align="right"><bean:message bundle="ALL_RESOURCE_KEY" key="servinceInjunction.intype.edit"/></td>
     <td width="55%" align="left">
      <html:select name="smsServiceInjunctionForm" property="injunctionType" οnchange="selectInjunction()">
       <html:option value="-1"><bean:message bundle="ALL_RESOURCE_KEY" key="servinceInjunction.pselect.edit"/></html:option>
       <html:option value="0"><bean:message bundle="ALL_RESOURCE_KEY" key="smsServinceInjunction.injunction"/></html:option>
       <html:option value="3"><bean:message bundle="ALL_RESOURCE_KEY" key="smsServinceInjunction.subcode"/></html:option>
       <html:option value="4"><bean:message bundle="ALL_RESOURCE_KEY" key="smsServinceInjunction.subcodeinjunction"/></html:option>
       <html:option value="7">默认路由</html:option>
      </html:select><font color="#FF0000"><html:errors property="defaulterror"/><bean:message bundle="ALL_RESOURCE_KEY" key="global.bitian"/></font>
      </td>
    </tr>

 

页面的表格

<table><tr>
      <td>
       <html:radio name="smsServiceInjunctionForm" property="injunctionMode" value="0"><bean:message bundle="ALL_RESOURCE_KEY" key="servinceInjunction.mode0.edit"/></html:radio>
       <html:radio name="smsServiceInjunctionForm" property="injunctionMode" value="1"><bean:message bundle="ALL_RESOURCE_KEY" key="servinceInjunction.mode1.edit"/></html:radio>
      </td>
      <td id="pipeizhengze" style="display:none">
       <html:radio name="smsServiceInjunctionForm" property="injunctionMode" value="2">正则匹配</html:radio>
      </td>
      <td>
       <font color="#FF0000"><bean:message bundle="ALL_RESOURCE_KEY" key="global.bitian"/></font>
      </td>
      </tr></table>

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值