Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: using a checkbox to display data


Message #1 by "Joe Ehrenfeld" <joee@v...> on Mon, 27 Aug 2001 17:22:20
One of my pages contains data from a recordset. Next to each row of data 

is a checkbox. If a user clicks any of the checkboxes then I want to be 

able to display that info on another page when the user clicks submit. 

Some of the data has textboxes, other pieces of data are for displaying 

purposes and cannot be changed by the user. How would I do that, display 

ONLY the rows that the user choose(using the checkbox) as well as the data 

of the row that was inputed by the user.



Thanks
Message #2 by "Ken Schaefer" <ken@a...> on Tue, 28 Aug 2001 16:26:56 +1000
Um, you put the PK values of the records in the value="" of the checkboxes

(which all have the same name). You can then get them in the next page via

Request.Form("chkboxname")



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

From: "Joe Ehrenfeld" <joee@v...>

Subject: [asp_web_howto] using a checkbox to display data





: One of my pages contains data from a recordset. Next to each row of data

: is a checkbox. If a user clicks any of the checkboxes then I want to be

: able to display that info on another page when the user clicks submit.

: Some of the data has textboxes, other pieces of data are for displaying

: purposes and cannot be changed by the user. How would I do that, display

: ONLY the rows that the user choose(using the checkbox) as well as the data

: of the row that was inputed by the user.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.com



Message #3 by "Arijit Mallick" <arijit.mallick@i...> on Wed, 29 Aug 2001 06:31:44
Gues that will be easy and multiple solns. r there.

I'll pass on the one I'll use for this:



On the 1st page, where u allow the selection of certain records, u must be 

rotating the recordset and listing the rows.

There itself, add a chekbox against each row as:



i=1

<%

while not rs.eof

%>

 <input type=checkbox id=chkRow<%=i%> name=chkRow<%=i%> value=1>

 etc.....

<% 

 rs.movenext

 i=i+1

wend

%>



Store the final count of i in a hidden field, say, Count.



Then POST the form to the second page.

There, get the Count from Request.Form("Count").



Do this:



for j=1 to Request.Form("Count")

 if request.form("chkRow" & j) = 1 then

  'show the Record....

 end if

next



HTH,

Arijit.



> One of my pages contains data from a recordset. Next to each row of data 

> is a checkbox. If a user clicks any of the checkboxes then I want to be 

> able to display that info on another page when the user clicks submit. 

> Some of the data has textboxes, other pieces of data are for displaying 

> purposes and cannot be changed by the user. How would I do that, display 

> ONLY the rows that the user choose(using the checkbox) as well as the 

data 

> of the row that was inputed by the user.

> 

> Thanks

  Return to Index