0

I have a page that displays the records from the database (repeated down) if the user selects (checkbox) a few records and clicks submit it passes the value (dbase record ID) to another page that retrieves the value and builds another recordset with just the records selected from the first page. :?: :?: :?:

The webmail pages make use of this (ie: select a few e-mails and click "trash" and those e-mails get deleted)

2
Contributors
1
Reply
2
Views
12 Years
Discussion Span
Last Post by hollystyles
0

Give your checkboxes the same name.

<input type="checkbox" name="mycheckbox" value="1">
<input type="checkbox" name="mycheckbox" value="2">
.
.
.
[i]n[/i]

Then when the form is posted you have an array which you can iterate or pass to a stored procedure or whatever your prefered method is.

sql="update table set column=value where id in ("

for i = 0 to Request.Form("mycheckbox").length - 1
        if i=0 then
            sql=sql & Request.Form("mycheckbox").item(i)
        else
            sql=sql & "," & Request.Form("mycheckbox").item(i) 
        end if
next

sql = sql & ")"

con.execute(sql)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.