/    Sign up×
Community /Pin to ProfileBookmark

click a radio button and a text box appears: How can i do this?

I’m working on a form where i have a a set of radio buttons where one of those buttons represents a chioce called ‘Other.’ After that, I want them to enter text for ‘other’ in a text box. Here’s the problem: I don’t want the user to be given that text box until they click the radio button for ‘other.’ How can I have the text box either invisible or ‘grayed-out’ right up to the point the user clicks ‘other?’

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@David_HarrisonAug 08.2003 — Hows this:

[upl-file uuid=2e8fc37d-ce5d-47b3-994b-51bf1183579c size=577B]radio show text box.txt[/upl-file]
Copy linkTweet thisAlerts:
@hellyeahauthorAug 11.2003 — Hell Yeah, That's what I'm looking for. Worked out great.

Many thanks. ?
Copy linkTweet thisAlerts:
@David_HarrisonAug 11.2003 — Happy to help. ?
Copy linkTweet thisAlerts:
@nkaisareAug 11.2003 — I'd rather do it this way:

<body onload="hide()">

<input type="text" id="boo" style="display: inline;">

This way, the textbox is available to the 13% users who turn off javascript.
Copy linkTweet thisAlerts:
@David_HarrisonAug 11.2003 — Nice catch, I didn't think of that.
×

Success!

Help @hellyeah spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...