1 var mobile = $("#UserMobile").val();
2 if (mobile != "") {
3 if (!(/^((\d{3}-\d{8}|\d{4}-\d{7,8})|(1[3|5|7|8][0-9]{9}))$/.test(mobile))) {
4 showMessage("手机号填写的格式不对,请正确填写");
5 return false;
6 }
7 }
1 function checkPwd2() {
2 var pwd2 = $("#pwd2").val();
3 if (/^[0-9a-zA-Z_]{6,15}$/.test(pwd2)) {
4 $("#lbl2").html("新密码符合要求");
5 $("#changePwd").attr("disabled", false);
6 return true;
7 }
8 else {
9 $("#lbl2").html("新密码输入有误,请按要求输入");
10 $("#changePwd").attr("disabled", "disabled");
11 return false;
12 }
13 }
![](https://images2015.cnblogs.com/blog/873720/201604/873720-20160425163822345-779775644.jpg)