No, I only have to record any changes to the checkboxes made after the search is completed, and actually the recording of the state of the checkboxes does not need to happen when a change is made. The way the form worked before is that a huge list (150+ checkbox items) shown. Users could then check/uncheck whatever they wanted and then they would click a save button at the bottom of the page. Obviously showing 150+ options to someone is a bit silly, nobody want's to read all that.
The form should work like so:
onpageload:
show all checkboxes
on textfield keyup:
repopulate list of checkboxes based on typed text
on savebutton click:
record any currently checked checkboxes
The way it works currently is that everything on the page is POSTed to another page and info is recorded to our DB. The checkboxes are generated based on the current info in the DB for the checkboxes, so the number of checkboxes can change if anything is added/removed. Since all of the checkboxes have the same ID, I just grab the value of that ID and it gives me any boxes that were checked and records them. The checked boxes are saved in one field in the DB, comma separated.
I realize now as I'm typing this that I can't do it that way anymore because any previously recorded checkboxes will be overwritten if they weren't part of the new list of checkboxes, but weren't unchecked... Hmm, I see a whole new issue now.
After thinking about this a bit I think I misunderstood what you meant about recording the state of the form before new content replaces it. Initially the whole list will be shown and anything that was previously checked will show up as checked. When the list is replaces with new content based on the search, then yes, anything checked should be recorded. On the new list of things, anything checked on there should be recorded as well, but previously recorded checked boxes should stay recorded.
I know this kinda went all over the place, lol, but I have a bunch of ideas now for things to try. I appreciate any additional comments you have though. Thanks for your reply, you got me thinking about this in a different way.