I have the code below . There are a "drop down" box ( or list box ) and a command button in my webpage.
In my box has 3 options (rock,rap ...) , then I click the command button and I want it to change the content of the option in the list box ( become horror, comedy, comic ... ).
But when I write the function change , I don't know what command I should use .
I hope that someone can help me .Thanks
<HTML>
<BODY>
<P>
<SELECT name=category style="HEIGHT: 22px; WIDTH: 119px" id=category ><OPTION selected
value="">All<OPTION
value=0>Action <OPTION
value=1>Horror<OPTION
value=2>Comedy</OPTION>
</SELECT>
<INPUT id=button name=button type=button value="change content of the list" onclick="change()"></P>
</BODY>
<SCRIPT LANGUAGE = "vbscript">
<!--
sub change()
document.datain.category.options= ????
' If I click button ...
' The 'category' dropdown control will change its options
' from
' <SELECT name=category style="HEIGHT: 22px; WIDTH: 119px" id=category onclick="change()"><OPTION selected
' value="">All<OPTION
' value=0>Action <OPTION
' value=1>Horror<OPTION
' value=2>Comedy</OPTION>
' </SELECT>
' to
' <SELECT name=category style="HEIGHT: 22px; WIDTH: 119px" id=category onclick="change()"><OPTION selected
' value="">All<OPTION
' value=0>rock <OPTION
' value=1>rap<OPTION
' value=2>country</OPTION>
' </SELECT>
end sub
-->
</SCRIPT>
</HTML>
In my box has 3 options (rock,rap ...) , then I click the command button and I want it to change the content of the option in the list box ( become horror, comedy, comic ... ).
But when I write the function change , I don't know what command I should use .
I hope that someone can help me .Thanks
<HTML>
<BODY>
<P>
<SELECT name=category style="HEIGHT: 22px; WIDTH: 119px" id=category ><OPTION selected
value="">All<OPTION
value=0>Action <OPTION
value=1>Horror<OPTION
value=2>Comedy</OPTION>
</SELECT>
<INPUT id=button name=button type=button value="change content of the list" onclick="change()"></P>
</BODY>
<SCRIPT LANGUAGE = "vbscript">
<!--
sub change()
document.datain.category.options= ????
' If I click button ...
' The 'category' dropdown control will change its options
' from
' <SELECT name=category style="HEIGHT: 22px; WIDTH: 119px" id=category onclick="change()"><OPTION selected
' value="">All<OPTION
' value=0>Action <OPTION
' value=1>Horror<OPTION
' value=2>Comedy</OPTION>
' </SELECT>
' to
' <SELECT name=category style="HEIGHT: 22px; WIDTH: 119px" id=category onclick="change()"><OPTION selected
' value="">All<OPTION
' value=0>rock <OPTION
' value=1>rap<OPTION
' value=2>country</OPTION>
' </SELECT>
end sub
-->
</SCRIPT>
</HTML>