G
Gerry
Hi,
I have a javascript function which uses the method
document.getElementById.
I'm using it to decide whether a checkbox has been ticked or not. This
decision is encoded in an if statement with the condtion being
if (document.getElementById(checkboxtoupdate).value ==1)
/* The Code */
function set(object)
{
var checkboxtoupdate = object.value;
if (document.getElementById(checkboxtoupdate).value ==1)
document.getElementById(checkboxtoupdate).value = 0;
else
document.getElementById(checkboxtoupdate).value = 1;
}
The "object" accesses a html tag which has an value attribute e.g
value="7400"
However Netscape Navigator 7.1 does not seem to recognise
"document.getElementById(checkboxtoupdate).value"
and reports an error that
document.getElementById(checkboxtoupdate).value has no properties.
But Internet Explorer has no problem with this at all.
Is there another way to do this so as to be recognised by Netscape
7.1?
I have a javascript function which uses the method
document.getElementById.
I'm using it to decide whether a checkbox has been ticked or not. This
decision is encoded in an if statement with the condtion being
if (document.getElementById(checkboxtoupdate).value ==1)
/* The Code */
function set(object)
{
var checkboxtoupdate = object.value;
if (document.getElementById(checkboxtoupdate).value ==1)
document.getElementById(checkboxtoupdate).value = 0;
else
document.getElementById(checkboxtoupdate).value = 1;
}
The "object" accesses a html tag which has an value attribute e.g
value="7400"
However Netscape Navigator 7.1 does not seem to recognise
"document.getElementById(checkboxtoupdate).value"
and reports an error that
document.getElementById(checkboxtoupdate).value has no properties.
But Internet Explorer has no problem with this at all.
Is there another way to do this so as to be recognised by Netscape
7.1?