googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

support binding of a group of radio buttons to a variable #123

Closed marycampione closed 11 years ago

marycampione commented 11 years ago

How do you bind a group of radio buttons to a single variable and give each radio button a value?

<input value="{{theData['catOrDog']}}" name="catOrDog" type="radio">Cat <input value="{{theData['catOrDog']}}" name="catOrDog" type="radio">Dog <input value="{{theData['catOrDog']}}" name="catOrDog" type="radio">Iguana

Essentially we need something on par with http://docs.angularjs.org/api/ng.directive:input.radio, and MDV does not currently have this.

sethladd commented 11 years ago

/sub

aeosynth commented 11 years ago

+1

i made a jsbin which pairs radio buttons to checkboxes; selecting a new radio button does not deselect the previous button's paired checkbox

rafaelw commented 11 years ago

Unfortunately, we can't make this a concern of MDV because it's a fundamental deficit of input elements.

There are some good ways to approach this at the Polymer level:

https://groups.google.com/forum/#!searchin/polymer-dev/radio/polymer-dev/n2jRJ49Rwdk/K4DBrxg8cC4J

https://github.com/Polymer/polymer-elements/blob/stable/polymer-selector/index.html