Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
var ContactForm = (function () {
var s;
return {
settings: {
inputs: $("#contact_form input"),
submitBtn: $(".js-contact_form-submit")
},
init: function() {
s = this.settings;
this.bindUIActions();
},
bindUIActions: function () {
s.submitBtn.on("click", function() {
if (!ContactForm.validate()) {
// If it doesn't validate, show some errors
}
});
},
validate: function (s.inputs) {
inputs.each(function() {
// Do some validation here.
}
}
};
})();
ContactForm.init();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment