Node.js based forum software built for the modern web
installer: confirm password
psychobunnyab2272b6b512
diff --git a/public/src/installer/install.js b/public/src/installer/install.jsindex ff3b92e542..0ec469ff5b 100644--- a/public/src/installer/install.js+++ b/public/src/installer/install.js@@ -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);}}});\ No newline at end of filediff --git a/src/views/install/index.tpl b/src/views/install/index.tplindex f611a7cf4c..5dbd31de84 100644--- a/src/views/install/index.tpl+++ b/src/views/install/index.tpl@@ -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>