summaryrefslogtreecommitdiff
path: root/users/app/assets/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'users/app/assets/javascripts')
-rw-r--r--users/app/assets/javascripts/users.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/users/app/assets/javascripts/users.js b/users/app/assets/javascripts/users.js
index 4195df8..2eb644b 100644
--- a/users/app/assets/javascripts/users.js
+++ b/users/app/assets/javascripts/users.js
@@ -3,7 +3,7 @@
// LOCAL FUNCTIONS
//
- var poll_users, prevent_default, form_failed, form_passed;
+ var poll_users, prevent_default, form_failed, form_passed, clear_errors;
prevent_default = function(event) {
return event.preventDefault();
@@ -15,6 +15,11 @@
}).done(process);
};
+ clear_errors = function() {
+ return $('#messages').empty();
+ };
+
+
//
// PUBLIC FUNCTIONS
//
@@ -38,6 +43,7 @@
// decorates the appropriate fields with the error messages.
//
srp.error = function(message) {
+ clear_errors();
var element, error, field;
if ($.isPlainObject(message) && message.errors) {
for (field in message.errors) {