M
MEM
I have a form where i alternate row color.
Code
================================================================================
var TABLE_ROW_COLOR_ODD = "#CECECE";
var TABLE_ROW_COLOR_EVEN = "#EEEEEE";
function stripeTableRows(tableObject,startRow)
{
var currentRowColor = "";
for (var i = startRow; i < tableObject.rows.length; i++)
{
currentRowColor = TABLE_ROW_COLOR_ODD;
if (i % 2 == 0)
{
currentRowColor = TABLE_ROW_COLOR_EVEN;
}
tableObject.rows.style.backgroundColor = currentRowColor;
}
}
//alternate row colors
function configurePage()
{
stripeTableRows(document.getElementById("table1"),1);
}
body onload="configurePage"
================================================================================
Ok, that works great. I'd like to do add functionality to dynamically
show/hide form rows based a selection criteria made in a drop down
box. The problem i'm having is trying to reset or reorder the row
colors dynamically. Any help would be appreciated.
Code
================================================================================
var TABLE_ROW_COLOR_ODD = "#CECECE";
var TABLE_ROW_COLOR_EVEN = "#EEEEEE";
function stripeTableRows(tableObject,startRow)
{
var currentRowColor = "";
for (var i = startRow; i < tableObject.rows.length; i++)
{
currentRowColor = TABLE_ROW_COLOR_ODD;
if (i % 2 == 0)
{
currentRowColor = TABLE_ROW_COLOR_EVEN;
}
tableObject.rows.style.backgroundColor = currentRowColor;
}
}
//alternate row colors
function configurePage()
{
stripeTableRows(document.getElementById("table1"),1);
}
body onload="configurePage"
================================================================================
Ok, that works great. I'd like to do add functionality to dynamically
show/hide form rows based a selection criteria made in a drop down
box. The problem i'm having is trying to reset or reorder the row
colors dynamically. Any help would be appreciated.