input 框 6-20位数字与字母的结合

$("#userPwd").blur(function() {
if(!/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/.test($("#userPwd").val())) {

if($("#userPwd").val() == "") {
$("#errorInfo2").html('*登录密码不可以为空!');
} else {
$("#errorInfo2").html("*密码格式错误");
$("#userPwd").val("");
}
} else {
$("#errorInfo2").html("");
}

});

posted @ 2016-09-23 09:07  迹地猿  阅读(1319)  评论(0编辑  收藏  举报