highlighting table row

i have created a table with rows alternately colored and each row containing a radio button.my question when i select a particular radio button that specific row should be colored differently.i can select any number of radio buttons and what ever buttons i have selected, that rows should be highlighted.when the radio button is deselected the row should regain its original bgcolor. ( remember that rows are alternately colored ).if anyone could give me an answer to this i will be thankful
aravind

Comments

  • I think there is a way to do this, though I haven't tried it yet. When the user clicks on the radio button, run a JavaScript function that does the following:

    1. Sets ALL the cells in the table to have the default background colour. I think you can do this with:
    document.formname.tablename.rowname.cellname.bgcolor = color;

    2. Pass a number to the function that indicates which row was selected. Based on this, use a switch() to change the background colour of that one row.

    I hope this helps.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion