密码:<input type="password" name="password" id="pwd">
<span id="s1"></span><Br>
确认密码:<input type="password" name="repassword" id="repwd">
<span id="s2"></span><Br>
<script type="text/javascript" src="webjars/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$("#pwd").blur(function () {
var password = $(this).val();
if (password==null||password.trim()==""){
$("#s2").text("密码不能为空");
flage2=false;
}else {
if (password.length<6){
$("#s2").text("密码长度不能小于6位");
}else {
$("#s2").text("√");
}
}
});
$("#repwd").blur(function () {
var repassword = $(this).val();
var password = $("#pwd").val();
if (password==repassword){
$("#s2").text("√");
}else {
$("#s2").text("两次密码不一致");
}
});
</script>
Ajax-重复密码校验
于 2023-02-07 19:43:24 首次发布