想了解免费建站的朋友,查看《免费建站教程》

搜索提交前js检查

2020-03-31 1283 JS
<div class="content" id="Step_4" style="height:200px; vertical-align:middle;">
  <table width="370" border="0" align="center">
    <form action="#" method="post" name="form4" target="_self" id="form4" onsubmit="return check4()">
      <tr>
        <td height="30" colspan="2" align="left"><strong class="font_size_14">安全监察人员相关信息(以下三项至少填两项)</strong></td>
      </tr>
      <tr>
        <td height="30" align="right" nowrap="nowrap" class="font_size">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:</td>
        <td align="left"><label>
          <input name="xm_aq" type="text" class="input_" id="xm_aq" />
        </label></td>
      </tr>
      <tr>
        <td height="30" align="right" nowrap="nowrap" class="font_size">身份证号码:</td>
        <td align="left"><input name="sfzh_aq" type="text" class="input_" id="sfzh_aq" /></td>
      </tr>
      <tr>
        <td height="30" align="right" nowrap="nowrap" class="font_size">证件编号:</td>
        <td align="left"><input name="zjbh_aq" type="text" class="input_" id="zjbh_aq" /></td>
      </tr>
      <tr>
        <td height="30" align="right" nowrap="nowrap" class="font_size">工作单位:</td>
        <td align="left"><input name="gzdw_aq" type="text" class="input_" id="gzdw_aq" /></td>
      </tr>
      <tr>
        <td colspan="2" align="center"><input type="submit" name="button4" id="button4" value="查询" style="border-width:1px; width:60px;"/></td>
      </tr>
    </form>
    <script>function check4()
      {  aa=0;
    if(form4.sfzh_aq.value==""){aa=1;}
    if(form4.zjbh_aq.value==""){aa=1;}
    if(form4.gzdw_aq.value==""){aa=1;}
    if(aa==0){return true;}
    if(aa==1){alert("请输全查询条件");return false;}
    }
      </script>
  </table>
  <br />
</div>


版权保护: 转载请保留链接: https://cgy.isi8.cn/js/31.html