Hi guys again, basically I have 2 scripts that both need to attach event handlers to different events onload. On attaches to "onkeyup" whilest the other attaches to "onchange". The scripts initialise as follows:
and:
The problem I have is that I cannot get both scripts to run simultaniously. Whichever script is included last is the only script that will work. both scripts work if I include them on their own or last. This is driving me insane so any help would be great.
Thanks in advance.
Gary
-Geeeeeeeeeeeeeeeeeeeeeeee-
Code:
window.onload = attachEditHandlers;
function attachEditHandlers() {
var objInput = document.getElementsByTagName('input');
for (var iCounter=0; iCounter<objInput.length; iCounter++)
objInput[iCounter].onchange = function(){return hasChanged(this);} //attach the onchange to each input field
}
and:
Code:
window.onload = attachFormHandlers;
function attachFormHandlers()
{
var form = document.getElementById('edit')
if (document.getElementsByTagName)//make sure were on a newer browser
{
var objInput = document.getElementsByTagName('input');
for (var iCounter=0; iCounter<objInput.length; iCounter++)
objInput[iCounter].onkeyup = function(){return validateMe(this);} //attach the onchange to each input field
}
}
The problem I have is that I cannot get both scripts to run simultaniously. Whichever script is included last is the only script that will work. both scripts work if I include them on their own or last. This is driving me insane so any help would be great.
Thanks in advance.
Gary
-Geeeeeeeeeeeeeeeeeeeeeeee-