How to delete many records in one click?

Results 1 to 4 of 4

Thread: How to delete many records in one click?

  1. #1
    Karel Guest

    Default How to delete many records in one click?

    How to delete many records in one click?<BR>And how can I attach a primary key to a checkbox for this purpose?<BR>Should I include an extra field in my db?

  2. #2
    Sam Otto Guest

    Default RE: How to delete many records in one click?

    Make the primary key of the record be the VALUE attribute of the checkbox. The checkbox for each record should be the same name. You don&#039t need an extra field in the DB. Assuming the Primary key is a number here&#039s and example:<BR><BR>&#060;input type=checkbox name=delID value=1> Record 1<BR>&#060;input type=checkbox name=delID value=2> Record 2<BR>&#060;input type=checkbox name=delID value=3> Record 3<BR><BR>When the form is submitted the next page you do:<BR><BR>delIDs = Request("delID")<BR><BR>Now you must parse delIDs since it will hold all the VALUEs delimited by commas of thecheckboxes that were checked...

  3. #3
    Sam Otto Guest

    Default RE: How to delete many records in one click?

    BTW the best way to parse the comma delimited string is to use the split function which will return an array of the values...

  4. #4
    Karel Guest

    Default RE: Thanks, but still...

    Sam,<BR><BR>Thanks a lot for your advise, but I&#039m still struggling with the split function<BR><BR><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
  •