Make fields required. Adapt fields to the attribute aria-describedby.pull/3306/head
parent
930bfc9855
commit
57b4127d1c
@ -1,16 +0,0 @@ |
||||
jQuery(function($) { |
||||
$('#new_password_confirmation, #new_password, #password').keyup(function() { |
||||
var passwordPresent = $('#password').val().length > 0; |
||||
var button = $('input[name="commit"]'); |
||||
var newPass = $('#new_password').val(); |
||||
var newPassConfirm = $('#new_password_confirmation').val(); |
||||
var newPasswordsMatches = newPass === newPassConfirm; |
||||
var newPasswordsPresent = (newPass.length > 0) && (newPassConfirm.length > 0); |
||||
|
||||
if (passwordPresent && newPasswordsMatches && newPasswordsPresent) { |
||||
button.removeAttr('disabled'); |
||||
} else { |
||||
button.attr('disabled','disabled'); |
||||
} |
||||
}); |
||||
}); |
Loading…
Reference in new issue