By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,384 Members | 1,886 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,384 IT Pros & Developers. It's quick & easy.

Enable text box when specific option is selected

P: n/a
I can enable a text box with an onChange if ANY option is selected
from a select list, but how do I do this for a specific selection?
Even better would be if the field didn't appear until after the
event. This is for those selecting "other" to tell us what "other"
is.

Thanks.

J Schlosser
Jul 2 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jul 2, 8:09 am, jschlosser <jschlos...@apic.orgwrote:
I can enable a text box with an onChange if ANY option is selected
from a select list, but how do I do this for a specific selection?
Even better would be if the field didn't appear until after the
event. This is for those selecting "other" to tell us what "other"
is.
In the onchange event of the select element, examine which option is
currently selected with the selectedIndex property. Then (enable and
show) or (disable and hide) the text area using something like
textarea.disabled=true;textarea.style.display='non e';

Give it a try with a complete demo web page that is just 40 lines or
less. If you have troubles you can post that code which will give
people a way to help you better.

Peter
Jul 2 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.