Posted by oeb on 11/29/05 17:04
ukrbend wrote:
> Is there a way to do a client side query (perhaps using a scripting
> language) that allows you to query info about an html table that was
> constructed on the server side via ASP? So for instance how many rows
> and columns the table has.
>
> Thanks for any help.
>
If you give the table a specific ID and onload count its child nodes
(<tr> tags) using DOM, that should return the number of rows it has. and
by counting the children of one of its child tags, you get the number of
cols (the number of <td> in the first <tr>)
Javascript would be very suitable for this, but I don't understand why
you need to validate data like this on the client side. Can't you just
do it on the server side where there is less to go wrong?
oeb
Navigation:
[Reply to this message]
|