Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Overriding CSS styles using JS  RSS feed

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a table for which its width, background color etc., are defined using CSS styles and applied using the <div> tag.

There is a checkbox in one of the columns and upon clicking the checkbox I would like to change the color of the selected/unselected ROW in the table. I am not able to override the initial styles specified using CSS. how can i do this ?? If i do not apply the table styles using CSS, I am able to change the color depending on the checkbox state, but when the styles are applied, there is no effect.

TIA
karthik
 
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without seeing the code, I have a feeling you are styling the cells with a background color and changing the row? Am I right?

Eric
 
Author and ninkuma
Marshal
Posts: 66783
168
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Karthik M",

There aren't may rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Karthik Mohan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric, my JS function is



I call the JS function like



where matInd_1_1 is the "id" for that table row ..

[double quotes are omitted due to errors while posting .. the spaces for the onclick event also for similar reasons]

thanks
karthik

[ August 08, 2005: Message edited by: Karthik M ]
[ August 08, 2005: Message edited by: Karthik M ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Karthik Mohan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That does not solve the problem. The table row's color is not changing at all.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just wrote you a fancy version of a script that changes the row color depending on the checkbox.



Eric
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!