Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to display a query result based on a user's input

Status
Not open for further replies.

dataplayer

Programmer
Jan 11, 2003
95
US
I am using Dream Weaver MX for an application form for parking space applicants. The applicant is supposed to choose a value from a list of car makes, and then to choose a car model from a listof car models. I want only those models under that car make to be listed.

I know how to select the car makes from the list, but don't know how to come up a list of models under the make. Could anyone help?

In the following is part of source code for selecting a make.

<% Set RS_CarMake = Server.CreateObject("ADODB.Recordset")
RS_CarMake.Open "Automake", park_conn, 2, 2
%>
<select name="REQappcarmake" onChange="ChangeDivision(0,'home',2);">
<option selected value="">Select A Make</option>
<%Do Until RS_CarMake.EOF%>
<option value="<%=RS_CarMake("veh_code")%>"><%=RS_CarMake("Make")%></option>
<%
RS_CarMake.MoveNext
Loop
%>
<option value="OT">Other</option>
</select>
<% RS_carmake.close
set RS_carmake = nothing %>

....

I am also including the model selecting part (the part to be improved) as follows:

<%
Set RS_model = Server.CreateObject("ADODB.Recordset")
SQL_model="select * from models
RS_model.Open SQL_model, park_conn, 2, 2
%>
<select name="select" onChange="ChangeDivision(0,'home',2);">
<option selected value="">Select A Model</option>
<%Do Until RS_model.EOF%>
<option value="<%=RS_model("modelID")%>"><%=RS_model("Model")%></option>
<%
RS_model.MoveNext
Loop
%>
<option value="OT">Other</option>
</select>
.....

Any hint and help are appreciated. Thanks.

Frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top