<form ... method="get">
<checkbox name="category[]" value="1">
<checkbox name="category[]" value="2">
<checkbox name="category[]" value="3">
...
I want the final get query to look like the following, if all items are checked:
?category=1,2,3
If only 1 and 3 are checked:
?category=1,3
What’s the best way to achieve this?
You could use Javascript to manipulate a hidden field:
When either checkbox is changed, update the value (i.e. “1,3” or “1,2,3”) as needed.