how do i delete multiple values in one go

Results 1 to 2 of 2

Thread: how do i delete multiple values in one go

  1. #1
    Join Date
    Dec 1969

    Default how do i delete multiple values in one go

    Hi ,<BR><BR>Well I will have about 25 rows of data...i want to have a checkbox with heading as delete..<BR><BR>Now when i click on different checkboxes like row 3, 8, 14, 21.<BR><BR>And i wanted to have a button like delete which should delete all the above checkboxes selected one shot.<BR><BR>How do i achieve this.<BR><BR>Thanks<BR><BR>jpn

  2. #2
    Join Date
    Dec 1969

    Default RE: how do i delete multiple values in one go

    On the page make sure each check box has the same name, and you add the records ID as the value to them<BR>ie:<BR>&#060;input type="checkbox" name="IDs" value="1"&#062;<BR>&#060;input type="checkbox" name="IDs" value="2"&#062;<BR>&#060;input type="checkbox" name="IDs" value="3"&#062;<BR>&#060;input type="checkbox" name="IDs" value="4"&#062;<BR>&#060;input type="checkbox" name="IDs" value="5"&#062;<BR><BR>Now do this on next page<BR>&#060;%<BR>myIDNumbers = Request.Form("IDs")<BR>Response.Write myIDNumbers<BR>%&#062;<BR><BR>Click some of your check boxes and see what it does on next page...<BR>(YOu should see a delimited list of the numbers)<BR>1,3,5<BR>that idea...<BR>Now all you have to do is put that inside the where clause using an<BR>IN() function<BR><BR>sql="Delete from tblName where ID IN(1,3,5)" &#039;will delete recs 1,3,5<BR><BR>sql="Delete from tblName where ID IN("& myIDNumbers &")"<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts