Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

disable text box and a label

 
Pranav Sharma
Ranch Hand
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im disabling a text field using javascript. but i wanted to know if there was anyway to change the color of the label too. it's a <TH></TH> and has a style class for it(both gray and black).

i want to change this dynamically depending on a drop down. i can change disable field. but dont know how to change label color

thanks
[ August 19, 2005: Message edited by: mannu kapoor ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65337
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change the colors using CSS.
 
Pranav Sharma
Ranch Hand
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya but how would i switch between black and gray when i switch values on the drop down washes.
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use
document.FORMBNAME.ELEMENTNAME.className = "the new style you want"
The new style should be present in your stylesheet.

If you are changing for the TH then you will have to give the TH an ID and then using document.getElementById("TH's ID").className = "the new style that you want".

hope this answers your question.
 
Pranav Sharma
Ranch Hand
Posts: 258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that helps thank you. did not know how to call the css class with javascript
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic