Link to home
Start Free TrialLog in
Avatar of Lennart Ericson
Lennart EricsonFlag for Sweden

asked on

Want a text box to appear if radio button is checked

Gurus and experts,
I am far from experienced in Javascript so I really need help.
Please see the attached file.When the last of the radio buttons  is checked, the one representing the value="other", I'd like a text box to appear after the text "Other:"
Please, could you help me get this to work.
Avatar of g3nu1n3
Flag of United States of America image

Why don't you use a javascript library like jQuery or MooTools to accomplish this, will be quite easier and allow for additional functionality you may need later in your project.
Avatar of Lennart Ericson


Probly a good suggestion. However, it doesn't solve my problem.
Avatar of Tom Beck
Tom Beck
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for your reply. Your code works perfectly when I test it. However, when I put it into my original code it does NOT work. I am sure I have done something odd, but can't find what is wrong. I take the liberty to ask you to take a quick look at my code to see if you can pick the oddity.
You have changed your text box attributes from this:

<input type="text" id="description_other" name="description_other" size="20" style="visibility:hidden;">

to this:

<input type="text" name="beskrivning_annat" size="20" style="display:none;" >

The javascript function is looking for a textbox with id="description_other" and  style="visibility:hidden".  You no longer have that so it is not working.
Thanks so much for all your help! I am most oblidged.
You're very welcome. Thanks for the points.