Commit 28fe54f1 authored by Rosanny Sihombing's avatar Rosanny Sihombing
Browse files

clean codes

parent 9b0bffa7
// check password and password confirmation input fields // check password and password confirmation input fields
// used in Security and Reset Password // used in Security and Reset Password
$('#inputNewPwd, #inputConfirm').on('keyup', function () { $('#inputNewPwd, #inputConfirm').on('keyup', function () {
var isBest, isMatch; let isBest, isMatch
isBest = checkPasswordReq($('#inputNewPwd').val()) isBest = checkPasswordReq($('#inputNewPwd').val())
$('#recommendation').empty(); $('#recommendation').empty()
if (!isBest) { if (!isBest) {
//$('#recommendation').html('Must be at least 8 characters').css('color', 'red'); // $('#recommendation').html('Must be at least 8 characters').css('color', 'red');
$('#recommendation').html('Das Passwort muss mindestens 8 Zeichen haben').css('color', 'red'); $('#recommendation').html('Das Passwort muss mindestens 8 Zeichen haben').css('color', 'red')
} }
// match or not? // match or not?
if ($('#inputNewPwd').val() == $('#inputConfirm').val()) { if ($('#inputNewPwd').val() == $('#inputConfirm').val()) {
//$('#message').html('Matching').css('color', 'green'); // $('#message').html('Matching').css('color', 'green');
$('#message').html('Übereinstimmend').css('color', 'green'); $('#message').html('Übereinstimmend').css('color', 'green')
isMatch = true; isMatch = true
} else { } else {
//$('#message').html('Not Matching').css('color', 'red'); // $('#message').html('Not Matching').css('color', 'red');
$('#message').html('Nicht übereinstimmend').css('color', 'red'); $('#message').html('Nicht übereinstimmend').css('color', 'red')
isMatch = false; isMatch = false
} }
// enable/disable update button // enable/disable update button
if (isBest && isMatch) { if (isBest && isMatch) {
$('#updateBtn').prop('disabled', false); $('#updateBtn').prop('disabled', false)
} else { } else {
$('#updateBtn').prop('disabled', true); $('#updateBtn').prop('disabled', true)
} }
}); })
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment