summaryrefslogtreecommitdiff
path: root/StoneIsland/www/js/lib/account/SignupView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-11-12 01:07:33 -0500
committerJules Laplace <jules@okfoc.us>2015-11-12 01:07:33 -0500
commitd45eae9bc88525c9332a301ab753491a68253462 (patch)
treeb0b47b7f23e31cb00932170c982f99b21fbd9778 /StoneIsland/www/js/lib/account/SignupView.js
parente474ead4fde530b1cb52f96e827269371120cb89 (diff)
validations for login, address
Diffstat (limited to 'StoneIsland/www/js/lib/account/SignupView.js')
-rw-r--r--StoneIsland/www/js/lib/account/SignupView.js30
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 = {