Hi !
I have a series of radio controls on a form, and I would like to know
when any of them is selected so I can update another control on the form.
Here is some code:
<%= label ''What style of lights were you thinking of using
?'',
:estimate, :default_light_style %>
<% @styles.each do |style| -%>
<label><%= radio_button :estimate, :default_light_style, style.last
%>
<%= h style.first %></label>
<% end -%>
<script type="text/javascript">
new Form.Element.EventObserver(''estimate_default_light_style'',
function(element, value) {alert(''found new value: '' +
value)});
</script>
I never see the alert in my JavaScript. If I observe the individual
radio buttons, I do get notified, but only the first time, because the
value of the radio button never changes afterwards.
Anybody has tips on how I should be handling this ?
Thanks !
François