Hi David,
Okay, first you need to be able to submit the form after clicking
on a particular radio button. You can accomplish this using:
<form name="theform" method="post" action="form.asp">
<input type="radio" name="selection_button" value="Option1"
onFocus="this.checked=true; this.submit()" >Option 1<br/>
<input type="radio" name="selection_button" value="Option2"
onFocus="this.checked=true; this.submit()">Option 2<br/>
</form>
The form should submit to itself where you would check to see
if option1 or option2 has been selected and then call the
appropriate SQL statement and store the results in a
recordset i.e.
<%
Selected_Option = Request.Form("selection_button")
If Selection_Option="option1" Then Call SQL_Function1() End If
If Selection_Option="option2" Then Call SQL_Function2() End If
%>
In the form at the top of this page you'll need to add the following
to populate the drop down list, assuming the record set is called
rs
<% If Selection_Option<>"" Then %>
<select name="combo_box">
<%
Do While Not rs.EOF
%>
<option
value="<%=rs.Fields("field_name").Value%>"><%=rs.F ields("field_name").Value%
</option>
<%
rs.MoveNext
Loop
%>
</select>
<% End If %>
I'm in a hurry so the code above may contain mistakes - but you
should get the general idea. There's probably dozens of methods
to accomplish this. Let me know if you have any problems.
Dominic
"David" <da*****@rocketmail.com> wrote in message
news:44**************************@posting.google.c om... Hi,
May I know how to create data dynamically in a combo box after
clicking on a radio button ? Data are retrieved using a store
procedure from a SQL Server.
For example :
Click Radio Button 1, the combo box should contains "A", "B", "C"
Click Radio Button 2, the combo box should contains "E", "F", "G"
The data can change dynamically after getting results from SQL Server.
Please shed some lights to me. I have been trying to find a solution
to this for a the past few days.
Thanks.