diff options
author | Dennis Eriksen <dennis.se@gmail.com> | 2013-03-20 12:43:33 +0100 |
---|---|---|
committer | Dennis Eriksen <dennis.se@gmail.com> | 2013-03-20 12:43:33 +0100 |
commit | 266767e6b31d4799b218a7dc9ffd0d6f2eca92a8 (patch) | |
tree | e3e68b3acdfb276cadcc23d0028a6c1dd3bc8f21 /public/js/form-validators/resetValidator.js | |
parent | Edited "Sign in" button - for fun (diff) | |
download | Divid-266767e6b31d4799b218a7dc9ffd0d6f2eca92a8.tar.gz |
login screen
Diffstat (limited to 'public/js/form-validators/resetValidator.js')
-rw-r--r-- | public/js/form-validators/resetValidator.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/public/js/form-validators/resetValidator.js b/public/js/form-validators/resetValidator.js new file mode 100644 index 0000000..71c8792 --- /dev/null +++ b/public/js/form-validators/resetValidator.js @@ -0,0 +1,37 @@ + +function ResetValidator(){ + +// modal window to allow users to reset their password // + this.setPassword = $('#set-password'); + this.setPassword.modal({ show : false, keyboard : false, backdrop : 'static' }); + this.setPasswordAlert = $('#set-password .alert'); +} + +ResetValidator.prototype.validatePassword = function(s) +{ + if (s.length >= 6){ + return true; + } else{ + this.showAlert('Password Should Be At Least 6 Characters'); + return false; + } +} + +ResetValidator.prototype.showAlert = function(m) +{ + this.setPasswordAlert.attr('class', 'alert alert-error'); + this.setPasswordAlert.html(m); + this.setPasswordAlert.show(); +} + +ResetValidator.prototype.hideAlert = function() +{ + this.setPasswordAlert.hide(); +} + +ResetValidator.prototype.showSuccess = function(m) +{ + this.setPasswordAlert.attr('class', 'alert alert-success'); + this.setPasswordAlert.html(m); + this.setPasswordAlert.fadeIn(500); +}
\ No newline at end of file |