Radio_button

I want to create an onclick event for the radio button. Here is what I
have:

<%= radio_button_tag ‘user’, ‘d_home’, :id => ‘user[d_home]’, :onclick
=> “new Effect.SwitchOff(‘apear-div’); new Effect.Fade( ‘apear-div’ )”
%>

Now, the radio button works fine along with the other members of the
group, is just doesn’t recognize the :onclick part. Anyone know what I’m
missing here? Thanks,

–S

Shandy N. wrote:

I want to create an onclick event for the radio button. Here is what I
have:

<%= radio_button_tag ‘user’, ‘d_home’, :id => ‘user[d_home]’, :onclick
=> “new Effect.SwitchOff(‘apear-div’); new Effect.Fade( ‘apear-div’ )”
%>

Now, the radio button works fine along with the other members of the
group, is just doesn’t recognize the :onclick part. Anyone know what I’m
missing here? Thanks,

Check the APIs for radio_button and radio_button_tag, you’re not
using them correctly:


We develop, watch us RoR, in numbers too big to ignore.

Shandy N. wrote:

I want to create an onclick event for the radio button. Here is what I
have:

<%= radio_button_tag ‘user’, ‘d_home’, :id => ‘user[d_home]’, :onclick
=> “new Effect.SwitchOff(‘apear-div’); new Effect.Fade( ‘apear-div’ )”
%>

Now, the radio button works fine along with the other members of the
group, is just doesn’t recognize the :onclick part. Anyone know what I’m
missing here? Thanks,

–S

Try this, it should work (note (a) checked attribute ‘true’ (b) options
within ‘{’ and ‘}’):

<%= radio_button_tag ‘user’, ‘d_home’, true, {:id => ‘user[d_home]’,
:onclick => “new Effect.SwitchOff(‘apear-div’); new Effect.Fade(
‘apear-div’ )”} %>

Roberto Gattinoni.