Check if passwords match with js
This commit is contained in:
parent
2c55fbc431
commit
6b730d5b33
@ -6,9 +6,19 @@
|
|||||||
|
|
||||||
{{template "head"}}
|
{{template "head"}}
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
function checkPasswordMatch() {
|
||||||
$('#invalidCredentials').hide();
|
var password = $("#password").val();
|
||||||
|
var confirmPassword = $("#password_confirm").val();
|
||||||
|
|
||||||
|
if (password != confirmPassword)
|
||||||
|
$("#divCheckPasswordMatch").html("Passwords do not match!");
|
||||||
|
else
|
||||||
|
$("#divCheckPasswordMatch").html("Passwords match.");
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
$("#password, #password_confirm").keyup(checkPasswordMatch);
|
||||||
$('#loginForm').ajaxForm({
|
$('#loginForm').ajaxForm({
|
||||||
success: function() {
|
success: function() {
|
||||||
window.location.href = "/api/v1/restricted";
|
window.location.href = "/api/v1/restricted";
|
||||||
@ -33,13 +43,12 @@
|
|||||||
<input type="text" name="name" /><br />
|
<input type="text" name="name" /><br />
|
||||||
|
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
<input type="password" name="password" /><br />
|
<input type="password" name="password" id="password" /><br />
|
||||||
|
|
||||||
<label for="password">Verify Password</label>
|
<label for="password">Verify Password</label>
|
||||||
<input type="password" /><br />
|
<input type="password" id="password_confirm" /><br />
|
||||||
|
|
||||||
<div id="invalidCredentials">
|
<div id="divCheckPasswordMatch">
|
||||||
The entered credentials are invalid
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="submit" value="Login" />
|
<input type="submit" value="Login" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user