Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting id from table

Status
Not open for further replies.

AndyApp

Programmer
Dec 20, 2001
259
GB
If I name a CELL in a table i.e. <TD ID=&quot;var&quot;> how do I call that ID later?

I need to be able to put the value into a session to be used on another page.

The ID is dynamically made using response.write so I don't know it in advance.

The value needs to be put into a SQL Statement that uses the TD ID as a comparison to the WHERE part of the statement.

Any help appreciated!

Merry Christmas
 
Im not sure i understand your question here. if you are writing the value using a response.write can you not assign it to a session variable at the same time? that way you dont need to retrieve it from the table id.


i dont think there is any easy way to find the id using javascript.

hope this helps

rob
 
oh i forgot if you post some code here for the page it might be easier to help

:)
 
Having thought more about it this still wouldn't resolve what i'm trying to do.

It's hard to explain as you've probably noticed.

If one result is returned then it is easy to get that and build an SQL statement with it. However if 2 or more results are returned I can only get it to recognise the last result that was written to screen.

I need to be able to make each individual result returned a link that uses either a variable or session to pass a SQL statement to another page. However the SQL Statement needs to reference the result the user clicks on and use it in the SQL Statement.

Understand? Not sure I do! The problem is 'catching' which result is actually clicked.

If you can understand that, then any help is appreciated.
 
what are they clicking on?
you should be able to cycle up though the nodes till you hit a &quot;tr&quot; and grab the id, won't work in all browsers though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top