Home | Advertising Info81 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Thursday, January 16, 2025  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - General
 PowerASP Code Help Area : Classic ASP - General
Subject Info: Using checkboxes to select records to upd A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
shadowspell
Newbie
Newbie
Avatar

Joined: May/04/2004
Location: United States
Online Status: Offline
Info: 13
Added: December/02/2004 at 9:38am | IP Logged Quote shadowspell

I display work request records from a db table into a .html table dynamically by cycling through the db table until RS.EOF.
To the right of each record displayed I have two checkboxes, "chk_dev_accept", "chk_dev_sendnotif". These are the only editable items on the page.
"chk_dev_accept" is clicked by the developer to assign the work request to his/herself.
"chk_dev_sendnotif" is clicked if the developer wants to notify the customer that the status of the job has changed (optional and automatic - I don't have a problem with this part).

Upon clicking the "Update Record" button, I want the records with the checkboxes clicked to update.
The db record fields that would be updated are: "dev_developer" (The developer that will do the job, read from a cookie) and "dev_proj_status" (changed to 'Assigned'). These two fields should update when the "chk_dev_accept" is clicked and form submitted. I want the developer to check as many records as he/she wishes.

My problem is I'm not sure how to code that <input checkbox....> tag, and then, how to take that checked value to select the appropriate records to update.

As always, thanks for any help, and if I need to clarify anything, I will be monitoring this string.
Thanks,
Chris
~`^%


__________________
~`^%
In Vino Veritas
Back to Top View shadowspell's Profile Search for other info by shadowspell
 
shadowspell
Newbie
Newbie
Avatar

Joined: May/04/2004
Location: United States
Online Status: Offline
Info: 13
Added: December/02/2004 at 5:21pm | IP Logged Quote shadowspell

As a primer, I began working with some simpler code to Delete files first rather than update. Here it is...

sDelete = Request.Form("dev_accept")

set cDelete = Server.CreateObject("ADODB.Command")
cDelete.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../marketing.mdb")
cDelete.CommandText = "DELETE FROM tbl_wr_Main WHERE tbl_wr_Main.id IN (" & sDelete & ")"
cDelete.CommandType = 1
cDelete.CommandTimeout = 0
cDelete.Prepared = true
cDelete.Execute()
Response.Redirect("dev_wr_jobs_pending.asp")

dev_accept is the name of dynamically created checkboxes created with each record read. The value of each is the rec id. Following the code you can see what is going on. This (to me) is a good start for the more challenging task of updating the records using the same priciple.

 



__________________
~`^%
In Vino Veritas
Back to Top View shadowspell's Profile Search for other info by shadowspell
 
cwilliams
Admin Group
Admin Group
Avatar

Joined: April/26/2004
Location: United States
Online Status: Offline
Info: 137
Added: December/02/2004 at 6:49pm | IP Logged Quote cwilliams

download aspprotect lite from www.cjwsoft.com
or www.aspprotect.com

it has good examples on the settings page of doing things like this.



Edited by cwilliams on December/02/2004 at 6:50pm


__________________


Chris Williams
http://www.PowerASP.com
Back to Top View cwilliams's Profile Search for other info by cwilliams
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2025 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com