This commit is contained in:
chenyang
2022-06-30 15:19:26 +08:00
parent c944791723
commit a059043c47
+11 -2
View File
@@ -70,6 +70,13 @@
const inputPassword = $('#inputPassword').val();
const inputPassword_ = $('#inputPassword_').val();
// 校验输入是否一致
const validate = validate_pw_eq(this, inputPassword, inputPassword_)
if (validate) {
}
});
function validate_pw_eq(obj, inputPassword, inputPassword_) {
if (inputPassword !== inputPassword_) {
const alert_component = `
<div class="alert alert-danger .alert-dismissible fade show" role="alert" id="register_alert">
@@ -79,12 +86,14 @@
</button>
</div>
`
$(this).after(alert_component)
$(obj).after(alert_component)
setTimeout(function () {
$('#register_alert').fadeOut(1200)
}, 1000)
return false
}
return true
}
});
// js end
})