Thanks so much for taking the time to help, appreciate it. (parentNode..
who knew? :o) )
Peter
> Subject: RE: rowIndex in Table
> From: "Albetski, Allan" <aalbetski@a...>
> Date: Tue, 28 May 2002 10:35:47 -0500
> X-Message-Number: 4
>
> something like this should work
>
> <body>
> <table border=1>
> <tr><td><button
> onClick="DeleteRow(this)">Delete</button></td><td>Row 1</td></tr>
> <tr><td><button
> onClick="DeleteRow(this)">Delete</button></td><td>Row 2</td></tr>
> </table>
> <script>
> function DeleteRow(object)
> {
> while (object.tagName != 'TR')
> {
> object = object.parentNode
> }
>
> var lRowNumber = object.rowIndex
> alert(lRowNumber)
> }
> </script>
> </body>
>
> -----Original Message-----
> From: plscribner@w... [mailto:plscribner@w...]
> Sent: Tuesday, May 28, 2002 12:36 PM
> To: javascript
> Subject: [javascript] rowIndex in Table
>
>
> Hi All,
>
> I've beat my head against the wall for a couple of days now so it's time
> to ask for help.
>
> Background:
> I have a table which I construct on the fly. Simple enough, it just lets
> users record line items on an invoice and when they are through with one
> line they click a button and the line gets added to a dynamic table. They
> repeat until all lines have been entered - could be 1 line coule be 100.
>
> Problem:
> The table contains a delete button in case the user blew the entry. To
> know which row to delete I need the rowIndex of the button they clicked.
> Do you think I can find a way to get that? I've tried 100 different
> syntaxes, scoured all the documentation I can find and just can't get it.
> I can find everything but how to get rowIndex.
>
> Could anyone give me a hand with this, I'm just baffled. Thanks very much
> in advance for anything you can suggest.
>
> Regards,
> Peter
>
>