mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 13:46:34 +02:00
installer: confirm password
This commit is contained in:
@@ -18,11 +18,8 @@ $('document').ready(function() {
|
||||
help.html(help.attr('data-help'));
|
||||
});
|
||||
|
||||
$('[name="username"]').on('blur', function() {
|
||||
validate('username', $(this));
|
||||
});
|
||||
$('[name="password"]').on('blur', function() {
|
||||
validate('password', $(this));
|
||||
$('[name]').on('blur', function() {
|
||||
validate($(this).attr('name'), $(this));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -49,11 +46,22 @@ $('document').ready(function() {
|
||||
}
|
||||
}
|
||||
|
||||
function validateConfirmPassword(field) {
|
||||
if ($('[name="password"]').val() !== $('[name="confirm"]').val()) {
|
||||
parent.addClass('error');
|
||||
help.html('Passwords do not match.');
|
||||
} else {
|
||||
parent.removeClass('error');
|
||||
}
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 'username':
|
||||
return validateUsername(field);
|
||||
case 'password':
|
||||
return validatePassword(field);
|
||||
case 'confirm':
|
||||
return validateConfirmPassword(field);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -62,6 +62,13 @@
|
||||
</div>
|
||||
<div class="col-sm-5 help-text" data-help="Use a combination of numbers, symbols, and different cases. You can change the strictness of password creation in the Admin Control Panel."></div>
|
||||
</div>
|
||||
<div class="row input-row">
|
||||
<div class="col-sm-7 col-xs-12 input-field">
|
||||
<label for="confirm">Confirm Password</label>
|
||||
<input type="password" class="form-control" name="confirm" placeholder="Confirm Password" />
|
||||
</div>
|
||||
<div class="col-sm-5 help-text" data-help="Re-enter your password again."></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user