var ProfileView = View.extend({ el: "#profile", events: { }, initialize: function(){ this.$form = this.$("form") this.$msg = this.$(".msg") }, show: function(){ app.footer.show("SAVE", "CANCEL") document.body.className = "profile" }, validate_presence: { "Name": "Please enter your first name.", "Surname": "Please enter your last name.", "Email": "Please enter a valid email address.", }, validate_fields: function(errors){ if (data.Password && ! data.Password2) { errors.push("Password2", "Please enter your new password.") } }, success: function(data){ }, error: function(data){ }, })