Display textbox when specific selection is made in a select drop-down

Display textbox when specific selection is made in a select drop-down

am 12.07.2007 16:45:06 von daniel

Hello,

I have a select statement which includes a 'Other' option. I would
like to know how to set it up so that if my user selects the 'Other'
option that a textbox appear next to it so they can enter details.

Thank you,

Daniel

Re: Display textbox when specific selection is made in a select drop-down

am 12.07.2007 19:46:01 von jkorpela

Scripsit Daniel:

> I have a select statement which includes a 'Other' option. I would
> like to know how to set it up so that if my user selects the 'Other'
> option that a textbox appear next to it so they can enter details.

You can't do that in HTML. You can do it in JavaScript, but then you should
take care of the functionality of the page when scripting is disabled. That
is, you should include the textbox normally in HTML and use JavaScript (when
enabled) to hide it until "Other" has been selected. More info:
http://www.cs.tut.fi/~jkorpela/forms/combo.html

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/