<form action="" method="post" onsubmit="return checkForm(this)">
<
input id="p_tel" type="text" name="p_tel" />

<input id="p_cardid" type="text" name="p_cardid" />

<button type="submit"> 查询</button>
</
form>

function checkForm(){
var phone = document.getElementById('p_tel').value;
var cardid=document.getElementById('p_cardid').value;
if(phone==""&&cardid==""){
alert("请输入手机号和身份证号!");return false;
}else if(phone==""){
alert("请输入手机号!");return false;
}else{
if(!(/^1(3|4|5|7|8)\d{9}$/.test(phone))){
alert("手机号码有误,请重新输入");
return false;
}
if(cardid==""){
alert("请输入身份证号!");return false;
}
}
if(!(/^[1-9]{1}[0-9]{14}$|^[1-9]{1}[0-9]{16}([0-9]|[xX])$/.test(cardid))){
alert("身份证号有误,请重新输入");return false;
}
}

 

 

查询

相关文章:

  • 2022-02-07
  • 2021-08-06
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案