| | |
recordset from multiple checkbox values
Please support our ASP advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
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)
The webmail pages make use of this (ie: select a few e-mails and click "trash" and those e-mails get deleted)
Give your checkboxes the same name.
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.
<input type="checkbox" name="mycheckbox" value="1">
<input type="checkbox" name="mycheckbox" value="2">
.
.
.
nThen 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.
ASP Syntax (Toggle Plain Text)
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)
![]() |
Similar Threads
- Insert multiple checkbox values of array into mysql db (PHP)
- get checkbox value (PHP)
- problem in passing multiple checkbox values (ASP)
- checkbox values calculation with PHP (PHP)
- checkbox values (JSP)
Other Threads in the ASP Forum
- Previous Thread: check box
- Next Thread: repeat region into declared variable (jmail body)
| Thread Tools | Search this Thread |
archive asp aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection






