473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Enable text box when specific option is selected

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
1 1701
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES...
9
by: Susan Bricker | last post by:
Hi. I have two questions ... (1) I want to use a Listbox to enable the user to select 1 or many items from the list. However, I'm having trouble figuring out how to find out t which items have...
3
by: jessy | last post by:
I dont know if im postin in the right forum coz im not sure whether this is JS or PHP problem .. my problem is i have a text field which is disabled and i need to enable it when the user selects...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.