This piece of script does exactly what I want it to but it comes up with an error on the
following line: ops = document.form1.poss.options.text;
error = 'document.form1.poss.options[...].text' is not an object
poss is the name of my select box. If I put a number in the error line in place of i (at
options), say 4, it prints out the text of select box value number 4, and there are no
errors.
With the way I have done it, it is perfect except that this error comes up. Why?????
<script>
ops = new Array();
var total = document.form1.poss.options.length;
var temp;
document.write("Select box option numbers: "+total+"<BR>"
for (i=0;i<=total;i++)
{
ops = document.form1.poss.options.text;
document.write(ops+"<BR>"
}
</script>
following line: ops = document.form1.poss.options.text;
error = 'document.form1.poss.options[...].text' is not an object
poss is the name of my select box. If I put a number in the error line in place of i (at
options), say 4, it prints out the text of select box value number 4, and there are no
errors.
With the way I have done it, it is perfect except that this error comes up. Why?????
<script>
ops = new Array();
var total = document.form1.poss.options.length;
var temp;
document.write("Select box option numbers: "+total+"<BR>"
for (i=0;i<=total;i++)
{
ops = document.form1.poss.options.text;
document.write(ops+"<BR>"
}
</script>