|
-
Sep 25th, 2000, 12:39 PM
#1
Hi there, I have a very puzzling question:
I need to be able to identify which cell of a table has been clicked once the mouse is hovering on the table.
Here's what the codes should look like:
<table id="mytable" border="1" cellspacing="1" width="100">
<tr>
<td> id="A1" width="50"</td>
<td> id="A2" width="50"</td>
</tr>
<td> id="A3" width="50"</td>
<td> id="A4" width="50"</td>
</table>
<script language=vbscript>
sub mytable_onMouseOver()
sub mytable_onClick()
{find out which cell id is clicked}
end sub
end sub
</script>
....Hope I've been clear enough......If you have any suggestion please forward it, it will be very much appreciated. Thanks
-
Sep 25th, 2000, 04:32 PM
#2
Unfortunately, you can't have nested Subs, Functions.
Here's what you can do to find out what TD was clicked.
Code:
<HTML>
<SCRIPT LANGUAGE=vbscript>
Sub MyTable_onclick
MsgBox document.activeElement.innerText
End Sub
</SCRIPT>
</HEAD>
<BODY>
<P> </P>
<TABLE id=MyTable border=1 width=500 cellpadding=1 cellspacing=1>
<TR>
<TD id=td1>td1</TD>
<TD id=td2>td2</TD>
<TD id=td3>td3</TD>
</TR>
<TR>
<TD id=td4>td4</TD>
<TD id=td5>td5</TD>
<TD id=td6>td6</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Regards,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|