var SignupView = SerializableView.extend({ el: "#signup", action: sdk.account.login, events: { "submit form": "save", }, initialize: function(){ this.$form = this.$("form") this.$msg = this.$(".msg") }, show: function(){ app.footer.show("SUBMIT", "CANCEL") this.$form.get(0).reset() this.$msg.html("* Your personal and payment information will always remain private") document.body.className = "signup" }, 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.", }, validate_fields: function(errors){ if (data.Password !== data.Password2) { errors.push("Password2", "Passwords don't match.") } }, success: function(data){ // change login in ui to logout or whatever }, error: function(data){ }, /* var new_user_data = { "Email": "testit.account" + Math.floor(Math.random() * 10000000) + "@yoox.com", "Password": "TestPassword", "Gender": "M", "Name": "TestName", "Surname": "TestSurname", "DataProfiling": true, } */ })