• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

disable text box and a label

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Change the colors using CSS.
 
Pranav Sharma
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ya but how would i switch between black and gray when i switch values on the drop down washes.
 
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
that helps thank you. did not know how to call the css class with javascript
 
reply
    Bookmark Topic Watch Topic
  • New Topic