View Single Post
Old 10-12-2012, 05:50 PM   PM User | #15
Piece Of Meat
New Coder

 
Join Date: Oct 2012
Posts: 16
Thanks: 3
Thanked 0 Times in 0 Posts
Piece Of Meat is an unknown quantity at this point
Quote:
Originally Posted by xelawho View Post
oh, sorry - I missed that. Where is your window onload function (ie, the one that waits for the contents of the window to be assembled before firing)?
Code:
function  validateForm()
{
	 attachEventListener(document.getElementById('addform'), "submit", validateadd, false);
	 function validateadd()
	 {
		 return checking('addfirst','addlast','addmail','addnumber');
	 }
	 attachEventListener(document.getElementById('editform'), "submit", validateedit, false);
	 function validateedit()
	 {
		 return checking('editfirst','editlast','editmail','editnumber');
	 }
	 var therows=document.getElementById("mytable").rows;
	 for (var i = 0; i < therows.length; i++) {
		 attachEventListener(therows[i],'mouseover',function(){this.style.backgroundColor="red"});
		 attachEventListener(therows[i],'mouseout',function(){this.style.backgroundColor="white"});
	}
};
And in the end of the js file:
Code:
addLoadListener(validateForm);
Piece Of Meat is offline   Reply With Quote