This is similar to a previous question I asked but I'm not sure if my intention was clear enough. So I have made a jsfiddle and provide more details of what I'm looking to achieve.
I'm trying to build a hash which I can then send via an ajax request to perform a query, the hash would look like this category = { "gender": '', "styles": [] };
There are a few things I would like to happen:
1) A user can only select Mens or Womens at any one time, causing the other option to become unclickable (the clicked option should always be in the JS object).
2) if a user has Mens selected already and then clicks on the same option then that option becomes unchecked and the womens option then becomes clickable and vice versa.
3) When a type (so Mountain Bike etc) is selected it as added to the styles array, and when that type is unchecked it is then removed.
With my jsfiddle the li class active is not being updated (even though the parameter class appears) and I can't seem to grab the closest label to enable the switch statement to work.