diff options
Diffstat (limited to 'StoneIsland/www/js/lib/account/SignupView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/account/SignupView.js | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/StoneIsland/www/js/lib/account/SignupView.js b/StoneIsland/www/js/lib/account/SignupView.js index e695e26f..616fd9ea 100644 --- a/StoneIsland/www/js/lib/account/SignupView.js +++ b/StoneIsland/www/js/lib/account/SignupView.js @@ -2,6 +2,8 @@ var SignupView = SerializableView.extend({ el: "#signup", + action: sdk.account.login, + events: { "submit form": "save", }, @@ -18,25 +20,25 @@ var SignupView = SerializableView.extend({ document.body.className = "signup" }, - validate: function(data){ - var errors = [] - if (! data.Name) { errors.push("Please enter your first name.") } - if (! data.Surname) { errors.push("Please enter your last name.") } - if (! data.Email) { errors.push("Please enter a valid email address.") } - if (! data.Password) { errors.push("Please enter your password.") } - if (! data.Password2) { errors.push("Please enter your password again.") } - if (data.Password !== data.Password2) { errors.push("Passwords don't match.") } - if (! data.DataProfiling) { errors.push("You must agree to share your data.") } - return errors + validate_presence: { + "Name": "Please enter your first name.", + "Surname": "Please enter your last name.", + "Email": "Please enter a valid email address.", + "Password": "Please enter your password.", + "Password2": "Please enter your password again.", + "DataProfiling": "You must agree to data profiling.", }, - - save: function(e){ - e && e.preventDefault() + + validate_fields: function(errors){ + if (data.Password !== data.Password2) { errors.push("Password2", "Passwords don't match.") } }, - success: function(){ + success: function(data){ // change login in ui to logout or whatever }, + + error: function(data){ + }, /* var new_user_data = { |
