Skip to content

Instantly share code, notes, and snippets.

@eresende
Created November 9, 2015 21:31
Show Gist options
  • Save eresende/e07ae7be4bce38f72141 to your computer and use it in GitHub Desktop.
Save eresende/e07ae7be4bce38f72141 to your computer and use it in GitHub Desktop.
How to create a new javascript object to deal with forms.
var Forms = (function(Forms) {
Forms.requestDemo = {
init: function(){
var self = Forms.requestDemo;
console.log('initalize stuff');
self._initFormFields();
self._initFormValidators();
self._initSubmit();
},
_initFormFields: function() {
console.log('init form fields here');
},
_initFormValidators: function() {
console.log('init validators here');
},
_initSubmit: function() {
console.log('init submit here');
}
};
return Forms;
})(Forms || {});
$(function() {
Forms.requestDemo.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment