diff options
Diffstat (limited to 'StoneIsland/www/js/lib/account/SignupView.js')
| -rw-r--r-- | StoneIsland/www/js/lib/account/SignupView.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/StoneIsland/www/js/lib/account/SignupView.js b/StoneIsland/www/js/lib/account/SignupView.js index d8459f9b..e695e26f 100644 --- a/StoneIsland/www/js/lib/account/SignupView.js +++ b/StoneIsland/www/js/lib/account/SignupView.js @@ -18,6 +18,18 @@ 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 + }, + save: function(e){ e && e.preventDefault() }, |
