Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dopr down list multiple rows

Status
Not open for further replies.

London12345

Programmer
Jun 30, 2011
5
0
0
GB
Hi,

I have 4 rows with each row has a dropdown list and a textbox
when i select fail from dropdown list then the textbox should be enabled else the textbox should be disabled with background color as grey.

please can you advise on writing a one javascript func for all 4 rows.
 
Pass the id of the element to be enabled/disabled as a parameter.

Try writing the code and posting it, then you can get help if needed.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Use the onChange event of the drop down, and simply test for the value in your function.

Code:
if(dropdown.value=="fail"){ textbox.diabled=true; }

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top