Quote:
Originally Posted by xelawho
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);