On my website, users can post articles and tag them accordingly using some pre-set tags. These tags are in the form of checkboxes. Example below:
You may try to have pictures with javascript onclick
event that would change img source
attribute. Then, put hidden control with given id
and in the same onclick
event use document.getElementById('hiddencontrol').value = 1 - document.getElementById('hiddencontrol').value
(with 0 or 1 as default).
However, I don't know how to make it without Javascript.