I recently started using Zurb Foundation 4 for the Asp MVC website, and I don’t quite understand how switch management should work. Docs don't say much http://foundation.zurb.com/docs/components/switch.html
<div class="switch">
<input id="x" name="switch-x" type="radio" checked>
<label for="x" onclick="">Off</label>
<input id="x1" name="switch-x" type="radio">
<label for="x1" onclick="">On</label>
<span></span>
</div>
I use this code example, when I click on the switch, there are no changes in html. I realized that the "checked" attribute will go on the second input, but this is not the case.
- How to determine which switch was pressed?
When I submit the form, the variable "switch-x" contains the value "on" no matter what position the switch is in.
I tried adding the onclick event to the label, but it does not fire, because something seems to overlap the label.
javascript , .
- ... ?