Click to See Complete Forum and Search --> : HELP - need multiple select boxes to work!


A_Thomas
10-24-2003, 04:32 AM
Hi, this is my first thread on the forum, i have asked this question on a couple of other forums, but with no luck.

Im developing a webpage where the user can build a PC from scratch, first the base unit must be selected, then the case then memory, hard disk etc... each seletion may only be made once the previouse selection has been selected.

eg you cannot select a case without a base unit.

Ive used list boxes and everything works fine. However i need to use multiple selection boxes for certain components. this is where im having trouble.

here is part of the code, how could i make the DISK DRIVES LIST SELECTION a multiple selection list.

The problems ive had so far when trying to use a multiple selection are:

I dont know how to get the querystring to pass the selected multiple options to the following list box.

I need to replace the ONCHANGE="MM_jumpMenu('parent',this,0) with a submit button when using the multiple selection box, but im not sure how to?

Any help is appreciated, ive been stuck on this for a few days now (code is below) the test site for this to understand the problem is http://212.106.97.250/index.asp , as you can see ive tried inserting a multiple box, but with no sucess

Andrew


<%

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,memory_price FROM pc_base,pc_cases,memory WHERE pc_base_model = '" & Request.QueryString("pc_base_model") & "' AND pc_case_model = '" & Request.QueryString("pc_case_model") & "'"
rs_memory.CursorType = 0
rs_memory.CursorLocation = 2
rs_memory.LockType = 1
rs_memory.Open()
rs_memory_numRows = 0

%> <p align="left"><font face="Arial"><font color="#008080"><b><SELECT name="memory" SIZE="1" ONCHANGE="MM_jumpMenu('parent',this,0)">
<%
If Request.QueryString("pc_case_model") <> "" Then
Response.Write("<option selected>Select a Memory Model</option>")
Do Until rs_memory.EOF
Response.Write("<option value='index.asp?pc_base_model=" & b_model_result & "&pc_base_price=" & b_price_result & "&pc_case_model=" & c_model_result & "&pc_case_price=" & c_price_result & "&memory_model=" & rs_memory("memory_model") & "&memory_price=" & formatcurrency((rs_memory("memory_price")).value, 2, -2, -2, -2) & "'>" & rs_memory("memory_model") & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[" & formatcurrency((rs_memory("memory_price")).value, 2, -2, -2, -2) & "]" & "</option>")

rs_memory.MoveNext
Loop
Else
End If
rs_memory.Close()
Set rs_memory = Nothing
%>
</SELECT>
</b></font></font>
</p>
</td>
</tr>
<tr>
<td bgcolor="#99FFFF"><span class="red">
<%
Response.Write("<option value='" & Request.QueryString("memory_model") & "' selected>" & Request.QueryString("memory_model") & "&nbsp;&nbsp;&nbsp;" & request.QueryString("memory_price") & "</option>")


%>
</span></td>
</tr>

<td><!--DISK DRIVES LIST SELECTION -->

<%

Set rs_dd = Server.CreateObject("ADODB.Recordset")
rs_dd.ActiveConnection = MM_conn_configurator2003_STRING
rs_dd.Source = "Select pc_base_model,pc_case_model,memory_model,dd_disk_model,dd_disk_price FROM pc_base,pc_cases,memory,disk_drives WHERE pc_base_model = '" & Request.QueryString("pc_base_model") & "' AND pc_case_model = '" & Request.QueryString("pc_case_model") & "' AND memory_model = '" & Request.QueryString("memory_model") & "'"
rs_dd.CursorType = 0
rs_dd.CursorLocation = 2
rs_dd.LockType = 1
rs_dd.Open()
rs_dd_numRows = 0

%> <p align="left"><font face="Arial"><font color="#008080"><b><SELECT name="dd" SIZE="1" ONCHANGE="MM_jumpMenu('parent',this,0)">
<%
If Request.QueryString("memory_model") <> "" Then
Response.Write("<option selected>Select a Disk Drive</option>")
Do Until rs_dd.EOF
Response.Write("<option value='index.asp?pc_base_model=" & b_model_result & "&pc_base_price=" & b_price_result & "&pc_case_model=" & c_model_result & "&pc_case_price=" & c_price_result & "&memory_model=" & m_model_result & "&memory_price=" & m_price_result & "&dd_disk_model=" & rs_dd("dd_disk_model") & "&dd_disk_price=" & formatcurrency((rs_dd("dd_disk_price")).value, 2, -2, -2, -2) & "'>" & rs_dd("dd_disk_model") & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[" & formatcurrency((rs_dd("dd_disk_price")).value, 2, -2, -2, -2) & "]" & "</option>")

rs_dd.MoveNext
Loop
Else
End If
rs_dd.Close()
Set rs_dd = Nothing
%>
</SELECT>
</b></font></font>
</p>
</td>
</tr>
<tr>
<td bgcolor="#CCFFFF"><span class="red">
<%
Response.Write("<option value='" & Request.QueryString("dd_disk_model") & "' selected>" & Request.QueryString("dd_disk_model") & "&nbsp;&nbsp;&nbsp;" & request.QueryString("dd_disk_price") & "</option>")


%>
</span></td>
</tr>


<td><!--OPTICAL DRIVES LIST SELECTION -->

<%

Set rs_optical = Server.CreateObject("ADODB.Recordset")
rs_optical.ActiveConnection = MM_conn_configurator2003_STRING
rs_optical.Source = "Select pc_base_model,pc_case_model,memory_model,dd_disk_model,optical_model,optical_price FROM pc_base,pc_cases,memory,disk_drives,optical_drives WHERE pc_base_model = '" & Request.QueryString("pc_base_model") & "' AND pc_case_model = '" & Request.QueryString("pc_case_model") & "' AND memory_model = '" & Request.QueryString("memory_model") & "' AND dd_disk_model = '" & Request.QueryString("dd_disk_model") & "'"
rs_optical.CursorType = 0
rs_optical.CursorLocation = 2
rs_optical.LockType = 1
rs_optical.Open()

rs_optical_numRows = 0

%> <p align="left"><font face="Arial"><font color="#008080"><b><SELECT name="optical" SIZE="1" ONCHANGE="MM_jumpMenu('parent',this,0)">
<%
If Request.QueryString("dd_disk_model") <> "" Then
Response.Write("<option selected>Select Optical Drives</option>")
Do Until rs_optical.EOF
Response.Write("<option value='index.asp?pc_base_model=" & b_model_result & "&pc_base_price=" & b_price_result & "&pc_case_model=" & c_model_result & "&pc_case_price=" & c_price_result & "&memory_model=" & m_model_result & "&memory_price=" & m_price_result & "&dd_disk_model=" & dd_model_result & "&dd_disk_price=" & dd_price_result & "&optical_model=" & rs_optical("optical_model") & "&optical_price=" & formatcurrency((rs_optical("optical_price")).value, 2, -2, -2, -2) &"'>" & rs_optical("optical_model") & "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[" & formatcurrency((rs_optical("optical_price")).value, 2, -2, -2, -2) & "]" & "</option>")

rs_optical.MoveNext
Loop
Else
End If
rs_optical.Close()
Set rs_optical = Nothing
%>
</SELECT>
</b></font></font>
</p>
</td>
</tr>
<tr>
<td bgcolor="#99FFFF"><span class="red">
<%
Response.Write("<option value='" & Request.QueryString("optical_model") & "' selected>" & Request.QueryString("optical_model") & "&nbsp;&nbsp;&nbsp;" & request.QueryString("optical_price") & "</option>")

%>
</span></td>