diff --git a/app/views/signup.scala.html b/app/views/signup.scala.html
index 56f2e3d..f1f59e0 100644
--- a/app/views/signup.scala.html
+++ b/app/views/signup.scala.html
@@ -23,7 +23,7 @@
diff --git a/public/javascripts/password.js b/public/javascripts/password.js
index e0db6c5..00ba3df 100644
--- a/public/javascripts/password.js
+++ b/public/javascripts/password.js
@@ -61,6 +61,21 @@ var checkPasswordStrength = function (password, userId, minPasswordLength, maxPa
return "WEAK_PASSWORD";
};
+var matchPasswords = function () {
+ var passwd = $('#password');
+ var confirmPasswd = $('#confirmPassword');
+ var confirmPasswdControlGroup = $('#confirm-password-control-group');
+ var confirmPasswdFeedback = $('#confirm-password-feedback');
+ if (passwd.val() !== confirmPasswd.val()) {
+ confirmPasswordMatch = false;
+ hasError(confirmPasswdControlGroup, confirmPasswdFeedback);
+ } else {
+ confirmPasswordMatch = true;
+ hasSuccess(confirmPasswdControlGroup, confirmPasswdFeedback);
+ }
+
+};
+
var registerPasswordStrengthChecker = function () {
var passwd = $('#password');
var passwdControlGroup = $('#password-control-group');
@@ -91,22 +106,12 @@ var registerPasswordStrengthChecker = function () {
hasSuccess(passwdControlGroup, passwordFeedback);
warnBlock.html('');
}
+ matchPasswords();
});
};
var registerPasswordMatcher = function () {
- var passwd = $('#password');
var confirmPasswd = $('#confirmPassword');
- var confirmPasswdControlGroup = $('#confirm-password-control-group');
- var confirmPasswdFeedback = $('#confirm-password-feedback');
- confirmPasswd.keyup(function () {
- if (passwd.val() !== confirmPasswd.val()) {
- confirmPasswordMatch = false;
- hasError(confirmPasswdControlGroup, confirmPasswdFeedback);
- } else {
- confirmPasswordMatch = true;
- hasSuccess(confirmPasswdControlGroup, confirmPasswdFeedback);
- }
- });
+ confirmPasswd.keyup(matchPasswords);
};
diff --git a/public/javascripts/signup.js b/public/javascripts/signup.js
index 82147d8..e0c76f8 100644
--- a/public/javascripts/signup.js
+++ b/public/javascripts/signup.js
@@ -149,20 +149,22 @@ var registerUserIDValidation = function () {
var acknowledgeButtonVisibility = function() {
var acknowledgementCheckBox = $('#acknowledgement');
+ var submitButton = $('#submit');
if (userIdCorrect && passwordCorrect && validEmailDomain && confirmPasswordMatch && confirmEmailMatch) {
acknowledgementCheckBox.prop("disabled",false);
+ submitButton.prop("disabled", !acknowledgementCheckBox.prop('checked'));
}else{
acknowledgementCheckBox.prop("disabled",true);
+ submitButton.prop("disabled",true);
}
};
-var triggerAlreadyFilledFields = setTimeout(function() {
+var triggerAlreadyFilledFields = function() {
$('input').each(function() {
var elem = $(this);
if (elem.val()) elem.change();
})
-}, 250);
-
+};
$(document).ready(function () {
registerUserIDValidation();
@@ -172,5 +174,5 @@ $(document).ready(function () {
acknowledgeButtonVisibility();
registerPasswordMatcher();
registerPasswordStrengthChecker();
- triggerAlreadyFilledFields();
+ setTimeout(triggerAlreadyFilledFields, 250);
});
\ No newline at end of file