How to determine html table row clicked?

IT79637
IT79637 used Ask the Experts™
on
I have a table, where each row has a text field in it. However, the first row of the column is reserved for the description.  The text fields are named amt1, amt2, amt3,...,amt10.  When I click on one of the text area fields, how can I determine the row number of the table using javascript?

So if I click into the text area in row 4 (relative 0), I know that I have clicked into 4th text area and the name is amt4.



Screen shot below.

Thanks
HTML2.jpg
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
add to the text input tag: onclick="alert(this.name);"

or ---
<script>
function clickedtxt(obj)
{
alert(obj.name)
}
</script>
and --
add to the text input tag onclick="clickedtxt(this);"


Author

Commented:
Works for me!
Thanks.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial