
Passing JScript array to another web page
I have an .asp page which basically lists records from an ADO record set
in a table. When a row of the table is clicked, on the screen I
highlight the row. I then use the push() method of an array to add the
row object to the array. My aim is to let the user highlight more than
one row and then click on a link (e. g. delete) to act on all the
highlighted rows. Highlighting the rows and putting their objects into
the array is working properly except for some issues with unhighlighting
some rows.
Once I have this array with one or more objects in it, I need to somehow
pass the JScript array to another page which will list the items
highlighted and ask the user to confirm the action. How can I pass the
array? Here is the Script I am using, pared down to show the relevant
parts. This script has been set to the onClick event of the <TR> tag of
the table.
<script language="JavaScript">
var highlightedRows = new Array();
function highlight(objRow) {
//Add the row to the array
highlightedRows.push(objRow);
//Highlight the row
objRow.style.backgroundColor = "#90bff4";
}
</script>
The <TR> tag appears as follows:
<tr id="Row100">
<td class="clsItem" width="40%" onClick="highlight(Row100)">Text
</td>
</tr>
When the item is clicked the highlight function is called with the id of
the <tr>. That object is added to the array.
When the delete (or other links) are clicked I want to act upon all the
rows in the array. How can I pass that array to another page?
The number of rows selected will be small, typically less than 20.
Does this make sense?
Thanks,
Chris
--
If you don't like lunchmeat, please remove it from my e-mail address to
send me an e-mail