I have a script that works fine in IE 6 but not in Firefox. I get the following error when debugging:
document.getElementById("routput") has no properties
Below is a small example to demonstrate
<form name="adder" method="post">
1<input type="radio" name="r1"checked section="0" value="1" onClick="addIt()" >
<br>
2<input type="radio" name="r1" section="0" value="2" onClick="addIt()" >
<br>
<br> <br>
3<input type="radio" name="r2"checked section="1" value="3" onClick="addIt()" >
<br>
4<input type="radio" name="r2" section="1" value="4" onClick="addIt()" >
<br>
Total<input name="routput" size="4" value="0" maxlength="10">
</form>
<SCRIPT type=text/javascript>
<!--
function addIt(){
sec1 = document.getElementsByName('r1');
sec2 = document.getElementsByName('r2');
for (i=0; i<sec1.length; i++)
{if (sec1.checked == true){val1 = sec1.value}}
for (i=0; i<sec2.length; i++)
{if (sec2.checked == true){val2 = sec2.value}}
currTotal = parseFloat(val1)+parseFloat(val2)
shipIndex=0
document.getElementById('routput').value = currTotal
}
//-->
</SCRIPT>
I direction of how to modify to work in Firefox would be appreciated.
Thanks
document.getElementById("routput") has no properties
Below is a small example to demonstrate
<form name="adder" method="post">
1<input type="radio" name="r1"checked section="0" value="1" onClick="addIt()" >
<br>
2<input type="radio" name="r1" section="0" value="2" onClick="addIt()" >
<br>
<br> <br>
3<input type="radio" name="r2"checked section="1" value="3" onClick="addIt()" >
<br>
4<input type="radio" name="r2" section="1" value="4" onClick="addIt()" >
<br>
Total<input name="routput" size="4" value="0" maxlength="10">
</form>
<SCRIPT type=text/javascript>
<!--
function addIt(){
sec1 = document.getElementsByName('r1');
sec2 = document.getElementsByName('r2');
for (i=0; i<sec1.length; i++)
{if (sec1.checked == true){val1 = sec1.value}}
for (i=0; i<sec2.length; i++)
{if (sec2.checked == true){val2 = sec2.value}}
currTotal = parseFloat(val1)+parseFloat(val2)
shipIndex=0
document.getElementById('routput').value = currTotal
}
//-->
</SCRIPT>
I direction of how to modify to work in Firefox would be appreciated.
Thanks