diff options
author | Azul <azul@leap.se> | 2012-11-13 12:00:13 +0100 |
---|---|---|
committer | Azul <azul@leap.se> | 2012-11-13 12:00:13 +0100 |
commit | 6ba3366f778340ebeaa73fd53372368b16de6c98 (patch) | |
tree | 8249f6cd14e1ba859fd63a35f9f24456cb307d13 /users/app/assets/javascripts/users.js.coffee | |
parent | 78475cb1b3d4f18a5c0a0fb326e6465b92a5f0e7 (diff) |
using client side validations during signup
Diffstat (limited to 'users/app/assets/javascripts/users.js.coffee')
-rw-r--r-- | users/app/assets/javascripts/users.js.coffee | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/users/app/assets/javascripts/users.js.coffee b/users/app/assets/javascripts/users.js.coffee index 8a9f0e9..ab437f6 100644 --- a/users/app/assets/javascripts/users.js.coffee +++ b/users/app/assets/javascripts/users.js.coffee @@ -1,8 +1,3 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ -# - preventDefault = (event) -> event.preventDefault() @@ -11,9 +6,9 @@ validOrAbort = (event) -> abortIfErrors = -> return if $.isEmptyObject(errors) - $.each errors, (field, error) -> - alert(error) - $('#srp_password').focus() + # we're relying on client_side_validations here instead of printing + # our own errors. This gets us translatable error messages. + $('.control-group.error input, .control-group.error select, control-group.error textarea').first().focus() event.stopImmediatePropagation() validatePassword = -> |