Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

Select records using checkboxes

Posted 22 Apr 2004 23:51:01
1
has voted
22 Apr 2004 23:51:01 Jan DQ posted:
I want to select records by using checkboxes and then display them on the bottom of the page or another page. How do I do this? I'm able to select the records and have them be displayed on the same page but it only shows one column. I want it to show all columns. Please help.
<pre id=code><font face=courier size=2 id=code>
&lt;%@LANGUAGE="VBSCRIPT"%&gt;
&lt;!--#include file="../../../Connections/Conn.asp" --&gt;
&lt;%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset"
Recordset1.ActiveConnection = MM_Conn_STRING
Recordset1.Source = "SELECT * FROM tblPriceLookup ORDER BY PartNbr ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%&gt;
&lt;%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 10
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%&gt;
&lt;html&gt;
&lt;body&gt;
&lt;%
part=Request.Form("part"
%&gt;

&lt;form action="PleaseHelpMe.asp" method="post"&gt;
&lt;%
While ((Repeat1__numRows &lt;&gt; 0) AND (NOT Recordset1.EOF))
%&gt;
&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;table width="92%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FF0000" id="partsTable"&gt;
&lt;tr&gt;
&lt;td width="4%" height="21"&gt;&lt;input type="checkbox" name="part" value="&lt;%=(Recordset1.Fields.Item("PartNbr".Value)%&gt;"
&lt;%if instr(part,(Recordset1.Fields.Item("PartNbr".Value)) then Response.Write("checked"%&gt;&gt;&lt;/td&gt;
&lt;td width="21%" bordercolor="#990000"&gt;&lt;%=(Recordset1.Fields.Item("PartNbr".Value)%&gt;&lt;/td&gt;
&lt;td width="74%"&gt;&lt;%=(Recordset1.Fields.Item("Description".Value)%&gt;&lt;/td&gt;
&lt;td width="1%"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%&gt;
&lt;br&gt;
&lt;input type="submit" value="Submit"&gt;
&lt;/form&gt;

&lt;p&gt;&nbsp;&lt;/p&gt;
&lt;p&gt;You like:
&lt;/p&gt;
&lt;table width="100%" border="1" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td width="9%" bgcolor="#CCCCCC"&gt;
&lt;%
choices = Request.Form("part"
choices = Split(choices, ","
For Each member in choices
Response.Write member
Next
%&gt;&lt;/td&gt;
&lt;td width="83%"&gt;
&lt;/td&gt;
&lt;td width="7%"&gt;&nbsp;&lt;/td&gt;
&lt;td width="1%"&gt;&nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;%
Recordset1.Close()
Set Recordset1 = Nothing
%&gt;
</font id=code></pre id=code>

Reply to this topic