You radio buttons have to have the same name in the html attributes.
Jon
On 9/20/05, Rahul Bhargava <rahul@ntag.com> wrote:>
> Hi,
>
> I made a little utility class that turns on a particular div when a radio
> button is clicked ? a RadioButtonDivToggler. As the name hopefully
suggests,
> when a radio button from the same group is clicked, a different div is made
> visible and the others are hidden. In essence, it toggles on (makes
visible)
> the div associated with the radio button from a group that you clicked.
> However, I''m having problems with the radio buttons not actually
setting
> their "checked" value correctly (I click button C, then click
button B, but
> then B and C were both selected!). The buttons are definitely in the same
> group (they have the same name attribute). Yes, I double-checked that ;-)
>
> The event observing is just this:
>
>
Event.observe(this.buttons[i],''click'',this.onChange.bindAsEventListener
> (this));
>
> I had to do a crazy hack in my object''s onChange method to
unselect the
> other radio buttons in the group by hand ? it''s slightly
ridiculous. And I
> don''t call Event.stop anyway.
>
> Any suggestions on where I might be mucking things up and leading to a
> radio button not acting like a member of a radio button group? Is it a side
> effect of Event.observe, or some unrelated nonsence?
>
> Thanks,
>
> Rahul
>
>
> _______________________________________________
> Rails-spinoffs mailing list
> Rails-spinoffs@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://wrath.rubyonrails.org/pipermail/rails-spinoffs/attachments/20050920/aba864fe/attachment.html