is null or not an object
hi, i am getting an error 'document.forma3.myselect3 is null or not an object' i have many forms on the page and the first of which will not error but the rest error. this javascript is being called from an asp page.
<script language='javascript'>
function setOptions(chosen,theformnum){
var ff = document.forms['forma' + theformnum].elements["tota" + theformnum];
var ee = document.forms['forma' + theformnum].elements["hidercnt" + theformnum].value;
ff.value = "$" + ee * chosen + ".00";
}
</script>
for i = 1 to 6
<form name='forma<%=i%>' method='post'>
<select name="myselect<%=i%"> onchange="setOptions(document.form<%=i%>.myselect< %=i%>.options[document.form<%=i%>.myselect<%=i%>.selectedIndex].value,'<%=i%>');">
<option value='1'>1</option>
<option value='2'>2</option>
<option value='3'>3</option>
<option value='4'>4</option>
<option value='5'>5</option>
<option value='6'>6</option>
</select>
<input type='text' name='tota<%=i%>'>
<input type='hidden' name='hidercnt' value='10'>
</form>
i am passing to the setOptions() function the option selected and the form number which should tell the function which form and which textbox to populate, the first select box works just fine, but any of the other select boxes produce the error (even if the first select box i chose is not the first one on the page). Please help.
Jim
|