R
Richard
Hello,
When I have the next example, it shows me if item 2 is selected YES or NO
<html>
<script language="javascript">
function doit()
{
alert(document.forms["tst_frm"].elements["listbox"].options[2].selected)
}
</script>
<body>
<FORM id=tst_frm name=tst_frm action=javascript:doit() method=post>
<SELECT multiple size=5 name=listbox>
<OPTION value=1>1</OPTION>
<OPTION value=2>2</OPTION>2
<oPTION value=3>3</OPTION>
<OPTION value=4>4</OPTION>
<OPTION value=5>5</OPTION>
</SELECT>
<INPUT type=submit value="DOit" name=submit>
</FORM>
</body>
</html>
When I change then name field to a name with brackets (array)
<SELECT multiple size=5 name=listbox[]> It won't work. How can the
javascript work with the brackets in the name fields
Many thanks in advance
Richard
When I have the next example, it shows me if item 2 is selected YES or NO
<html>
<script language="javascript">
function doit()
{
alert(document.forms["tst_frm"].elements["listbox"].options[2].selected)
}
</script>
<body>
<FORM id=tst_frm name=tst_frm action=javascript:doit() method=post>
<SELECT multiple size=5 name=listbox>
<OPTION value=1>1</OPTION>
<OPTION value=2>2</OPTION>2
<oPTION value=3>3</OPTION>
<OPTION value=4>4</OPTION>
<OPTION value=5>5</OPTION>
</SELECT>
<INPUT type=submit value="DOit" name=submit>
</FORM>
</body>
</html>
When I change then name field to a name with brackets (array)
<SELECT multiple size=5 name=listbox[]> It won't work. How can the
javascript work with the brackets in the name fields
Many thanks in advance
Richard