Ti serve creare un row selector. Ecco il codice...
<html>
<head>
<style>
td {font-family: Verdana; font-size: 10pt;}
.tdHighlight {background-color: #808080; color: white; font-weight:normal; cursor:hand;}
.tdNormal {background-color: "#e0e0e0"}
.tdHeader {background-color: "#000080"; color: #ffffff; font-weight: bold;}
.btnHidden {visibility:hidden}
</style>
<script language="javascript">
<!--
function selectItem(name) {
ret=document.getElementById("btnSubmit");
document.all.rowId.value = name.parentElement.childNodes[0].innerText;
ret.click();
}
function showHighlight(name) {
var rowObj=name.parentElement;
rowObj.childNodes[0].className = 'tdHighlight';
rowObj.childNodes[1].className = 'tdHighlight';
rowObj.childNodes[2].className = 'tdHighlight';
}
function clearHighlight(row) {
document.all.mainTable.childNodes[0].childNodes[row].childNodes[0].className = 'tdNormal';
document.all.mainTable.childNodes[0].childNodes[row].childNodes[1].className = 'tdNormal';
document.all.mainTable.childNodes[0].childNodes[row].childNodes[2].className = 'tdNormal';
}
function clearInfoBox(row) {
infoBox.style.visibility = "hidden";
}
//-->
</script>
</head>
<body>
<form action="action.asp" method="post">
<input type="hidden" name="rowId">
<table id="mainTable" border="0" cellspacing="1" cellpadding="3" width="220">
<tr>
<td width="20" class="tdHeader">ID</td>
<td width="100" class="tdHeader">Field1</td>
<td width="100" class="tdHeader">Field2</td>
</tr>
<tr>
<td class="tdNormal" onClick="selectItem(this)" onMouseOver="showHighlight(this)" onMouseOut="clearHighlight(1)">1</td>
<td class="tdNormal" onClick="selectItem(this)" onMouseOver="showHighlight(this)" onMouseOut="clearHighlight(1)">Value</td>
<td class="tdNormal" onClick="selectItem(this)" onMouseOver="showHighlight(this)" onMouseOut="clearHighlight(1)">Value</td>
</tr>
<tr>
<td class="tdNormal" onClick="selectItem(this)" onMouseOver="showHighlight(this)" onMouseOut="clearHighlight(2)">2</td>
<td class="tdNormal" onClick="selectItem(this)" onMouseOver="showHighlight(this)" onMouseOut="clearHighlight(2)">Value</td>
<td class="tdNormal" onClick="selectItem(this)" onMouseOver="showHighlight(this)" onMouseOut="clearHighlight(2)">Value</td>
</tr>
<tr>
<td class="tdNormal" onClick="selectItem(this)" onMouseOver="showHighlight(this)" onMouseOut="clearHighlight(3)">3</td>
<td class="tdNormal" onClick="selectItem(this)" onMouseOver="showHighlight(this)" onMouseOut="clearHighlight(3)">Value</td>
<td class="tdNormal" onClick="selectItem(this)" onMouseOver="showHighlight(this)" onMouseOut="clearHighlight(3)">Value</td>
</tr>
</table>
<input type="submit" id="btnSubmit" name="btnSubmit" value="submit" class="btnHidden">
</form>
</body>
</html>
Ciao, Ricky.