Air Jordans - Find jobs - Debt Consolidation - Debt Consolidation - Natwest Credit Card

PDA

View Full Version : Getting IE Error in this code please help


Gunda
Apr 23rd 2007, 9:53 am
hello

can some one help me i get a error from this code in IE

function agreeTerms()
{
document.getElementById("upload").disabled=false
document.getElementById("checkBox").checked=true
}
function denyTerms()
{
document.getElementById("upload").disabled=true
document.getElementById("checkBox").checked=false
}

any idea whats wrong ?

nico_swd
Apr 23rd 2007, 9:58 am
What error do you get?

Gunda
Apr 23rd 2007, 10:03 am
'document.getElementById(...)' is null or not an object

and the checkbox is like this

<input type="checkBox" onclick="if (this.checked) {agreeTerms()} else {denyTerms()}">

giraph
Apr 23rd 2007, 12:29 pm
You would need to have it be:

<input id="checkBox" type="checkBox" onclick="if (this.checked) {agreeTerms()} else {denyTerms()}">

to use getElementById() correctly.