here is an example that will work in both firefox and IE. this should give you everything you would want to know about the radio button that was clicked
-
-
function radioClicked(btn){
-
var tbl,cell,row,rowIndex,cellIndex,tblID;
-
cell = btn.parentNode;
-
row= cell.parentNode;
-
tbl=row.parentNode;
-
while(tbl.nodeName!="TABLE")//this is incase the table has a body tbl=tbl.parentNode;
-
rowIndex = row.rowIndex; //starts at 0 so we will add 1
-
rowIndex++;
-
cellIndex = cell.cellIndex; //starts at 0 so we will add 1
-
cellIndex++;
-
tblID = tbl.id;
-
alert("A radio button has been clicked in row " + rowIndex + " cell " + cellIndex + " in table whos id is " + tblID);
-
}
-
-
[HTML]
<table id='Table1' border=1>
<tr>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
</tr><Tr>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
</tr><tr>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
</tr>
</table><br>
<table id='Table2' border=1>
<tr>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
</tr><Tr>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
</tr><tr>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
<td><input name='btn' onclick='radioClicked(this)' type='radio'/>radio button</td>
</tr>
</table>
[/HTML]