in reply to [Solved]: How to get only changed parameter names from CGI script on form submit?

Why not ask the database about the current state and then build the UPDATE actions as necessary on form submission?

Alternatively, send the user two variables for each checkbox, one indicating the old state and one indicating the new state. If the two differ, do the update.

  • Comment on Re: How to get only changed parameter names from CGI script on form submit?

Replies are listed 'Best First'.
Re^2: How to get only changed parameter names from CGI script on form submit? (clobber)
by tye (Sage) on Nov 23, 2015 at 18:08 UTC

    No, you want to update the values that the user updated, not the ones that differ from the DB. As a general principle, if a value changes in the DB after the page was loaded and before the form was submitted, then you should preserve the value in the DB, not clobber somebody else's update with this user's non-update. That generally leads to fewer problems and surprises.

    - tye