This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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