Text box to appear after combo box selection?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
cturner
Forum Contributor
Posts: 153
Joined: Sun Jul 16, 2006 3:03 am
Location: My computer

Text box to appear after combo box selection?

Post by cturner »

I want to know how I can make a text box appear after someone has made a certain selection from a combo box using JavaScript?

--- Option 1 ---
--- Option 2 ---
--- Option 3 ---
--- Other --- (on select make text box appear)

Thanks in advance.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You will need to use the onchange attribute of the <select> tag. The code will need to check the value of the select to determine if it is indeed "other" and then alter the display or visibility properties controlling the input.
User avatar
neel_basu
Forum Contributor
Posts: 454
Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India

Post by neel_basu »

Use The Textbox in a separate div
After the onhange event on the select the appropiate textbox would be
appenden in the div

You Can Use document.getElementById("divname")
and
appendChild()
Post Reply