I cant seen to find out what Im doing wrong
var newcustomerform = $('#newcustomerform');
//hide new customer form
function hideForm(){
newcustomerform.hide();
}
$(function(){
hideForm(); //this doesnt work
});
Whats the issue here?
I cant seen to find out what Im doing wrong
var newcustomerform = $('#newcustomerform');
//hide new customer form
function hideForm(){
newcustomerform.hide();
}
$(function(){
hideForm(); //this doesnt work
});
Whats the issue here?
You must wait for the DOM to load before trying to point to a DOM element. To do that, put var newcustomerform = $('#newcustomerform');
inside the $(function(){
i.e. just above where you call hideForm()