Forums
This topic is locked
Select records using checkboxes
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>
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../../../Connections/Conn.asp" -->
<%
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
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<html>
<body>
<%
part=Request.Form("part"
%>
<form action="PleaseHelpMe.asp" method="post">
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<table width="92%" border="1" cellpadding="0" cellspacing="0" bordercolor="#FF0000" id="partsTable">
<tr>
<td width="4%" height="21"><input type="checkbox" name="part" value="<%=(Recordset1.Fields.Item("PartNbr".Value)%>"
<%if instr(part,(Recordset1.Fields.Item("PartNbr".Value)) then Response.Write("checked"%>></td>
<td width="21%" bordercolor="#990000"><%=(Recordset1.Fields.Item("PartNbr".Value)%></td>
<td width="74%"><%=(Recordset1.Fields.Item("Description".Value)%></td>
<td width="1%"> </td>
</tr>
</table></td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<br>
<input type="submit" value="Submit">
</form>
<p> </p>
<p>You like:
</p>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="9%" bgcolor="#CCCCCC">
<%
choices = Request.Form("part"
choices = Split(choices, ","
For Each member in choices
Response.Write member
Next
%></td>
<td width="83%">
</td>
<td width="7%"> </td>
<td width="1%"> </td>
</tr>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
</font id=code></pre id=code>