判断密码中是否有空格
if (/^[\s ]|[ ]$/gi.test(cryptogram)) {
alert("密码没有空格哟");
return false;
}
验证邮箱
// 验证邮箱
$("#emailInput").blur(function () {
var emailInput = $("#emailInput").val()
var reg = /^([A-z0-9]{6,18})(\w|\-)+@[A-z0-9]+\.([A-z]{2,3})$/
if(emailInput.trim().length < 1) {
$("#emailInput").addClass("redWarningInput")
$("#restWarningPicture").show()
$("#resetImg").hide()
$("#noneEmail").html("邮箱为空!")
} else if(!reg.test(emailInput)) {
$("#emailInput").addClass("redWarningInput")
$("#restWarningPicture").show()
$("#resetImg").hide()
$("#noneEmail").html("该邮箱不存在")
} else {
$("#emailInput").removeClass("redWarningInput")
$("#restWarningPicture").hide()
$("#resetImg").show()
$("#noneEmail").html("")
}
});
// 验证码button是否禁用
$("#phoneNumber").blur(function () {
var phoneNumber = $(this).val()
if (/^[1][3,4,5,7,8][0-9]{9}$/.test(phoneNumber)) {
$(this).removeClass('redWarningInput')
$("#successImg1").show()
$("#forgetWarningPicture").hide()
$("#forgetPwdWord").html('')
$("#forgetResetButton").attr('disabled', false);
$("#forgetResetButton").css("color", "#111111");
$("#forgetResetButton").click(function () {
updateCode();
})
} else {
$(this).addClass('redWarningInput')
$("#forgetWarningPicture").show()
$("#successImg1").hide()
$("#forgetPwdWord").html('该手机号不存在')
}
}