日期:2014-05-16  浏览次数:20435 次

怎么样用正达表达式验证身份证
<script>function sub_form(the){ if(the.gsmc.value=="") {  alert("请输入公司名称!");  the.gsmc.focus();  return false; } if(the.dz.value=="") {  alert("请输入公司地址!");  the.dz.focus();  return false; } if(the.lxr.value=="") {  alert("请输入联系人!");  the.lxr.focus();  return false; } }</script> 
------解决方案--------------------
这里应该没问题,可能是你提交触发函数没有return
onclick="sub_form(the)"是错误的,应该是 onclick="return sub_form(the)"