<ga******@gmail.com> kirjoitti
viestissä:11**********************@f14g2000cwb.goo glegroups.com...
The following script works fine in IE...but gives me a "sBox has no
properties" error in Firefox. sBox is only used in the below method.
function addTop (sectId) {
sBox = document.getElementById("addo_" + sectId);
topo = sBox.options[sBox.selectedIndex].value;
if (topo != '0'){
drawTop(sectId, topo);
} else {
alert('Please select a topic.');
}
}
I can't see the problem...anyone have any suggestions to try? Thanks
for your time.
Don't know just how many times I've suggested this, but it's always worked.
Make sure you have defined an id for the element. If it has just a name it
works in IE but it is wrong. Unless it has an id attribute it won't work in
Firefox. The error is in IE, not Firefox. But it pleases me to see that
people are more and more testing the pages with Firefox and discovering
these problems.
So if your select looks something like this...
<select name="addo_0">
<option....
</select>
It should be like
<select name="addo_0" id="addo_0">
<option....
</select>
Also, for the future, it would be useful if you presented also an example of
the form, not just the javascript code.
--
SETI @ Home - Donate your cpu's idle time to science.
Further reading at <http://setiweb.ssl.berkeley.edu/>
Soulman <et****************@5P4Mgmail.com>