Hi,
I have a javascript function which uses the method
document.getEle mentById.
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.getEl ementById(check boxtoupdate).va lue ==1)
/* The Code */
function set(object)
{
var checkboxtoupdat e = object.value;
if (document.getEl ementById(check boxtoupdate).va lue ==1)
document.getEle mentById(checkb oxtoupdate).val ue = 0;
else
document.getEle mentById(checkb oxtoupdate).val ue = 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.getEl ementById(check boxtoupdate).va lue"
and reports an error that
document.getEle mentById(checkb oxtoupdate).val ue 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.getEle mentById.
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.getEl ementById(check boxtoupdate).va lue ==1)
/* The Code */
function set(object)
{
var checkboxtoupdat e = object.value;
if (document.getEl ementById(check boxtoupdate).va lue ==1)
document.getEle mentById(checkb oxtoupdate).val ue = 0;
else
document.getEle mentById(checkb oxtoupdate).val ue = 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.getEl ementById(check boxtoupdate).va lue"
and reports an error that
document.getEle mentById(checkb oxtoupdate).val ue 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?
Comment