View Single Post
  #2 (permalink)  
Old April 22nd, 2004, 05:22 AM
happygv happygv is offline
Friend of Wrox
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Name all the checkboxes with same name with each having the value as the ID/Key field value in your table. When you submit that page, all the values of all check boxes (whichever is checked) are passed under the same name with values separated by COMMA. So you can loop through those values or use them as it is in you update statement depending on the nature of the Update statement.

Assume the following records.
KeyVal Name
1 Vijay
2 Cici
3 Planoie
4 Pgtips

If you have Checkboxes named as "chkUpdate" and Value of each checkbox for each record as 1, 2, 3, 4

Then If you have checked only the checkboxes of Vijay and Cici, then on submission to the other page, when retrieved as

Response.write Request.Form("chkUpdate")

will hold value as "1,2"

Then you can split them into an array using SPLIT function.

ArrUpdate = Split(Request(Form("chkUpdate"))

You can use this in Update statement looping through the array values

Start LOOP Based on i
 "Update MyTable Set Name=" & Request.Form("Name") & "Where KeyVal=" & Arr(i)

Note : I have just given you the Pseudocode above there. Syntactically you should make changes as needed.

Hope that helps.


-Vijay G