Skip to main content
Inspiring
March 15, 2008
Question

Checkbox question again

  • March 15, 2008
  • 1 reply
  • 265 views
I have ten checkboxes, name cb1, cb2..etc, with vaules 1, 2, etc. I have different names because the technique i use to redisplay the checkboxes required different names.

Anyways, I insert into my table using cfif isDefined("form.cb1"), etc, for each checkbox and insert the values 1, 2, etc. in to the table if the box is checked, along with a status of Active.

So far so good, but here is the problem that I am haveing :

I bring up the form in edit mode and I display all ten checkboxes, and the ones that were previously checked, I have a checkmark in them (query from the table). For example, checkboxes 1, 5, and 8 were/are checked, so those values are in the table as active and display on the screen with checkmarks.

If they decide to edit and uncheck 5, and uncheck 8 (leave 1 checked) and check 2, 3, and 4, how would I update the table to change the status of 5 and 8 from active to inactive ?

Right now, I just delete all the current entries (1, 5 and 8) and just readd the new ones 1, 2, 3, 4 as active (using primary key).

But I need to keep track of the active and inactive status. How can I do that ?

Can someone please provide some code or examples ?

Thanks
    This topic has been closed for replies.

    1 reply

    Inspiring
    March 15, 2008
    Sounds like you need another table. One with a date field in it.
    trojnfnAuthor
    Inspiring
    March 15, 2008
    The table that I am currently using already has a date in it.

    It has an incremental line number/id, the checkbox value, the date, the primary key, and the status.

    What does the date have to do with my question ?