<script type="text/javascript"> function checkform() { var re; var ss = document.getElementById(‘txtMobile‘).value; re = /^(1[358][0-9]{9})$/; if (re.test(ss)==false) { alert("手机号码输入不合法"); return false; } var id=document.getElementById("txtIDNUMBER").value; var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; if (reg.test(id) === false) { alert("身份证输入不合法"); return false; } } </script>