I have a form that has 4 checkboxes. They are displayed as checked or not as according to what is in the database.
When the form is submitted I need to compare the in initial state of checkboxes so that if any are changed then I can add the code to update database.
eg initial form
checkbox 1 - checked
checkbox 2
checkbox 3 - checked
checkbox 4
then edited to this
checkbox 1 - checked
checkbox 2
checkbox 3
checkbox 4- checked
The database entries would therefore not need to change for checkbox 1 or 2 but would need to update the database to reflect the changes of 3 & 4.
Is this possible or should I simply delete the all the entries when the form is submitted and add the new values??
Any ideas appreciated
Cheers
When the form is submitted I need to compare the in initial state of checkboxes so that if any are changed then I can add the code to update database.
eg initial form
checkbox 1 - checked
checkbox 2
checkbox 3 - checked
checkbox 4
then edited to this
checkbox 1 - checked
checkbox 2
checkbox 3
checkbox 4- checked
The database entries would therefore not need to change for checkbox 1 or 2 but would need to update the database to reflect the changes of 3 & 4.
Is this possible or should I simply delete the all the entries when the form is submitted and add the new values??
Any ideas appreciated
Cheers