Thanks for the replies. I'm adopting a script I found at the following URL
http://forums.devshed.com/javascript...e-87376-2.html
My version works by using onmousedown to select any cell in a table, and with onmouseover and onmouseup, select a rectangular range of cells. I'd like to put the selected cell IDs (or VALUES) in an array (for PHP later on). Here's my current script....
-
function checkHighlight (id)
-
{
-
var idmarker = id.split( '.' );
-
var column;
-
var row;
-
-
for ( row = startrow; row <= tableRows; row++ )
-
{
-
for ( column = startcol; column <= tableColumns; column++ )
-
{
-
document.getElementById( column + '.' + row ).style.backgroundColor = '#FFFFFF';
-
}
-
}
-
counter=0;
-
myCells=new Array();
-
for ( row = startrow; row <= idmarker[1]; row++ )
-
{
-
for ( column = startcol; column <= idmarker[0]; column++ )
-
{
-
document.getElementById( column + '.' + row ).style.backgroundColor = highlightColor;
-
counter++;
-
myCells[counter]=document.getElementById(id).innerHTML;
-
}
-
}
-
// document.getElementById( 'tableSize' ).innerHTML = idmarker[1] + 'x' + idmarker[0];
-
// document.getElementById( 'tableSize' ).innerHTML = myCells[0]+','+myCells[1]+','+myCells[2];
-
}
-
Unfortunately this just fills the array with duplicates of the last cell selected. Any sugesstions to fill the array with all the cells selected?
Thanks in advance!