Forum Moderators: open
Within the list box a description is displayed "model" (which works and code is below) I also need the price displayed within this option box "price" for each selection box.
I have tried the following, <option selected><% = Request.Form("pc_base_model") %><% = Request.Form("base_price") %></option>
but the price did not appear, I also tried another way where the price did appear but could not get the following drop down list box to appear, or it did appear but before the fist list box was selected!
here is the code, any help is appreciated - thanks
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/conn_configurator2003.asp" -->
<%
Dim rs_base
Dim rs_base_numRows
Set rs_base = Server.CreateObject("ADODB.Recordset")
rs_base.ActiveConnection = MM_conn_configurator2003_STRING
rs_base.Source = "Select Distinct pc_base_model FROM pc_base"
rs_base.CursorType = 0
rs_base.CursorLocation = 2
rs_base.LockType = 1
rs_base.Open()
rs_base_numRows = 0
%>
</font>
<p style="margin-top: 0; margin-bottom: 0">
<p style="margin-top: 0; margin-bottom: 0">
<font size="2">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:
collapse" width="100%" id="AutoNumber1">
PC Configurator
<tr>
<td width="50%">
<FORM METHOD="POST" name="Form1" ACTION="index.asp">
<p align="left">
<SELECT name="pc_base_model" SIZE="1" ONCHANGE=Form1.submit()>
<option selected><% = Request.Form("pc_base_model") %></option>
<%
Do Until rs_base.EOF
%>
<OPTION><%= rs_base("pc_base_model") %></OPTION>
<%
rs_base.MoveNext
Loop
%>
</SELECT>
<font face="Arial" size="2">Select a Base unit</font></p>
</FORM>
<!--Second drop down -->
<%
Dim rs_case
Dim rs_case_numRows
Set rs_case = Server.CreateObject("ADODB.Recordset")
rs_case.ActiveConnection = MM_conn_configurator2003_STRING
rs_case.Source = "Select pc_case_model,pc_base_model FROM pc_cases,pc_base WHERE pc_base_model = '" & Request.Form("pc_base_model") & "'"
rs_case.CursorType = 0
rs_case.CursorLocation = 2
rs_case.LockType = 1
rs_case.Open()
rs_case_numRows = 0
%>
<FORM METHOD="POST" name="Form2" ACTION="index.asp">
<p align="left">
<font face="Arial"><font color="#008080"><b>
<SELECT name="pc_case_model" SIZE="1" ONCHANGE=Form2.submit()>
<option selected><% = Request.Form("pc_case_model") %></option>
<%
Do Until rs_case.EOF
%>
<OPTION><%= rs_case("pc_case_model") %></OPTION>
<%
' Get next record
rs_case.MoveNext
Loop
%>
</SELECT>
</b></font><b><font size="2" color="#008080"> </font></b>
<font size="2">Select a Case</font><font color="#008080"><b>
<input type="hidden" name="pc_base_model" value="<% = Request.Form("pc_base_model")
%>"></b></font></font></p>
</FORM>
<%
rs_case.Close()
Set rs_case = Nothing
%>
<!--third drop down -->
<%
Dim rs_memory
Dim rs_memory_numRows
Set rs_memory = Server.CreateObject("ADODB.Recordset")
rs_memory.ActiveConnection = MM_conn_configurator2003_STRING
rs_memory.Source = "Select pc_base_model,pc_case_model,memory_model FROM pc_base,pc_cases,memory WHERE pc_base_model = '" & Request.Form("pc_base_model") & "' AND pc_case_model = '" & Request.Form("pc_case_model") & "'"
rs_memory.CursorType = 0
rs_memory.CursorLocation = 2
rs_memory.LockType = 1
rs_memory.Open()
rs_memory_numRows = 0
%>
<FORM METHOD="POST" name="Form3" ACTION="index.asp">
<p align="left"> <font face="Arial"><font color="#008080"><b>
<SELECT name="memory" SIZE="1" id="memory">
<option selected><% = Request.Form("memory_model") %></option>
<%
Do Until rs_memory.EOF
%>
<OPTION><%= rs_memory("memory_model") %></OPTION>
<%
rs_memory.MoveNext
Loop
%>
<%
%>
</SELECT>
</b></font><b><font size="2" color="#008080"> </font></b>
<font size="2">Select Memory</font></font></p>
<input type="hidden" name="pc_case_model" value="<% = Request.Form("pc_case_model") %>">
<input type="hidden" name="pc_base_model" value="<% = Request.Form("pc_base_model") %>">
</FORM>
<%
rs_memory.Close()
Set rs_memory = Nothing
%>
<%
rs_base.Close()
Set rs_base = Nothing
%>