Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

populating dropdown boxes based on previous select

Posted 28 Mar 2007 23:57:25
1
has voted
28 Mar 2007 23:57:25 Raina Pinge posted:
Hello,

I have 4 dropdown boxes, each box is related to a field in my table. selecting the first dropdown should populate 2, 2 will populate 3rd and 3rd will populate 4 th.

i am missing a where clause coz i do not know how it works in dreamweaver. this code is in dreamweaver and i inherited it.

i am pasting the code below

<%
Dim rs_gatescreen1
Dim rs_gatescreen1_cmd
Dim rs_gatescreen1_numRows

Set rs_gatescreen1_cmd = Server.CreateObject ("ADODB.Command"
rs_gatescreen1_cmd.ActiveConnection = MM_conn_studio_STRING
rs_gatescreen1_cmd.CommandText = "SELECT feature_title FROM tbl_screenings"
rs_gatescreen1_cmd.Prepared = true

Set rs_gatescreen1 = rs_gatescreen1_cmd.Execute
rs_gatescreen1_numRows = 0
%>

<%
Dim rs_gatescreen2
Dim rs_gatescreen2_cmd
Dim rs_gatescreen2_numRows

Set rs_gatescreen2_cmd = Server.CreateObject ("ADODB.Command"
rs_gatescreen2_cmd.ActiveConnection = MM_conn_studio_STRING
rs_gatescreen2_cmd.CommandText = "SELECT date1 FROM tbl_screenings ORDER BY date1 ASC"
rs_gatescreen2_cmd.Prepared = true

Set rs_gatescreen2 = rs_gatescreen2_cmd.Execute
rs_gatescreen2_numRows = 0
%>

<%
Dim rs_gatescreen3
Dim rs_gatescreen3_cmd
Dim rs_gatescreen3_numRows

Set rs_gatescreen3_cmd = Server.CreateObject ("ADODB.Command"
rs_gatescreen3_cmd.ActiveConnection = MM_conn_studio_STRING
rs_gatescreen3_cmd.CommandText = "SELECT times1 FROM tbl_screenings"
rs_gatescreen3_cmd.Prepared = true

Set rs_gatescreen3 = rs_gatescreen3_cmd.Execute
rs_gatescreen3_numRows = 0
%>

<%
Dim rs_gatescreen4
Dim rs_gatescreen4_cmd
Dim rs_gatescreen4_numRows

Set rs_gatescreen4_cmd = Server.CreateObject ("ADODB.Command"
rs_gatescreen4_cmd.ActiveConnection = MM_conn_studio_STRING
rs_gatescreen4_cmd.CommandText = "SELECT location1 FROM tbl_screenings ORDER BY location1 ASC"
rs_gatescreen4_cmd.Prepared = true

Set rs_gatescreen4 = rs_gatescreen4_cmd.Execute
rs_gatescreen4_numRows = 0
%>

and this is my dropdown code:

Screening
Feature:
<select name="screening_date" type="text" id="screening_date"/><option value="Select">Select</option>
<%While (NOT rs_gatescreen1.EOF)%> <option value="<%=(rs_gatescreen1.Fields.Item("feature_title".Value)%>"><%=(rs_gatescreen1.Fields.Item("feature_title".Value)%></option> <% rs_gatescreen1.MoveNext()
Wend
%>
</div></th>
</tr>
<tr>
<td colspan="3" bgcolor="#EAF4FF" scope="col"><strong>Screening Date:
<select name="screening_date" type="text" id="screening_date"/><option value="Select">Select</option>
<%While (NOT rs_gatescreen2.EOF)%> <option value="<%=(rs_gatescreen2.Fields.Item("date1".Value)%>"><%=(rs_gatescreen2.Fields.Item("date1".Value)%></option> <% rs_gatescreen2.MoveNext()
Wend
%>
</strong></td>
</tr>
<tr>
<td colspan="3" bgcolor="#EAF4FF" scope="col"><strong>Screening Time:
<select name="screening_time" type="text" id="screening_time"/><option value="Select">Select</option>
<%While (NOT rs_gatescreen3.EOF)%> <option value="<%=(rs_gatescreen3.Fields.Item("times1".Value)%>"><%=(rs_gatescreen3.Fields.Item("times1".Value)%></option> <% rs_gatescreen3.MoveNext()
Wend
%>
</strong></td>
</tr>

<tr>
<td colspan="3" bgcolor="#EAF4FF" scope="col"><strong>Screening Location:
<select name="screening_location" type="text" id="screening_location"/><option value="Select">Select</option>
<%While (NOT rs_gatescreen4.EOF)%> <option value="<%=(rs_gatescreen4.Fields.Item("location1".Value)%>"><%=(rs_gatescreen4.Fields.Item("location1".Value)%></option> <% rs_gatescreen4.MoveNext()
Wend
%>

i need the population to work based on my selections in the drop down. Any help is appreciated.

Thank you

Raineel

Reply to this topic