JavaScript and client side scripting.
Moderator: General Moderators
cturner
Forum Contributor
Posts: 153 Joined: Sun Jul 16, 2006 3:03 am
Location: My computer
Post
by cturner » Thu Jan 11, 2007 11:24 pm
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Jan 11, 2007 11:46 pm
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.
neel_basu
Forum Contributor
Posts: 454 Joined: Wed Dec 06, 2006 9:33 am
Location: Picnic Garden, Kolkata, India
Post
by neel_basu » Fri Jan 12, 2007 12:49 am
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()