window.myDemoApp ={
// a save function for my email input
// will always be executed, but 3. input indicates if the inputValue is valid
saveCustomerEmail : function(inputValue, $inputElement, isValidInput, isPageValidation){
console.error('saveCustomerEmail() ',inputValue, $inputElement, isValidInput, isPageValidation);
//do your stuff here...
},
// custom Validator function
validateFullName : function($el, errormsg, isPageValidation){
console.error('input to validateFullName() ', $el.val());
// return true or false here.
// you can also return an object with custom erromsg
return {
status : false,
errormsg : 'Shit happens'
}
}
};
// wait until document is done rendered before set up store and
// update DOM with storedata
$(document).ready(function(){
gj.store.setData({
fullname : "Donald Trumph"
}, $('body'));
});
Email:
// simple gj-form input setup (this is just a functional example )
// in real life you would use gjl.formline for this