I have a dynamically created table that is filled with rows and columns of checkboxes.
Their unique id's are dynamically created as well.
I would like to store the order that the checkboxes are checked by the user in the checkboxs' values.
If a checkbox is unchecked, its value should be reset to "" or to "0".
It doesn't matter how many times a checkbox is checked and unchecked.
I only need the ultimate order, so an incrementing variable should work fine.
For example:
- There are checkbox1 - checkbox10 and all their values are initially set to "".
- If the user first clicked on checkbox3 its value would be set to "1".
- If the user then clicked on checkbox5 its value would be set to "2".
- If the user then clicked on checkbox8 its value would be set to "3".
- If checkbox3 and checkbox5 were unclicked, their values would be reset to "".
- If checkbox3 were checked yet again its value would be set to "4".
- It would not matter that there was no checkbox with a value of 1 or 2.