arturadib / agility

Javascript MVC for the "write less, do more" programmer
http://agilityjs.com
MIT License
542 stars 70 forks source link

Binding for radio buttons #111

Closed ghost closed 1 year ago

ghost commented 10 years ago

Radio buttons are not always siblings. Start searching from the root element of the view will solve this problem.

phonovision commented 10 years ago

An example would be Bootstrap markup:

<div class="radio">
  <label>
    <input type="radio" name="optionsRadios" id="optionsRadios1" value="option1" checked>
    Option one is this and that&mdash;be sure to include why it's great
  </label>
</div>
<div class="radio">
  <label>
    <input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
    Option two can be something else and selecting it will deselect option one
  </label>
</div>

So this seems to be an established approach.