To Enable a disabled text_field onclick of radio button?

Hi,

I have 3 radio buttons, with 1st checked. If the 3rd radio button is
clicked, i want to enable the text_field.

Anything wrong in the code below? It doesn’t work :frowning:

<%= radio_button :profile, :nick_name, “passport_style”, :checked =>
“checked”, :onclick => “$(‘other_text’).disable();” %> <%=
@profile.first_name + " " + @profile.last_name %>

<%= radio_button :profile, :nick_name, “school_style”, :onclick =>
“$(‘other_text’).disable();” %> <%= @profile.first_name + " " +
@profile.last_name[0…0] %>

<%= radio_button :profile, :nick_name, “user_own_style” ,
:onclick => “$(‘other_text’).enable();” %>

<%= text_field ‘user_choice’, ‘user_choice’,
:disabled => true %>

Regards,
Sandeep G

The problem is that your text field is not called “other_text”, your
span is. You need to change your code to $(‘user_choice’) and this
should work.

-Bill

Sandeep G. wrote:

@profile.first_name + " " + @profile.last_name %>

:disabled => true %>

Regards,
Sandeep G


Sincerely,

William P.