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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returning a session variable based on users response

Status
Not open for further replies.

JohnVogel

Programmer
Apr 19, 1999
117
US
Hello,

I am trying to write an ASP page that returns some data in a database. The results are returned in a table format. What I would like to do is have a session variable set when a person clicks on one of the rows.
I have allready figured out how to get a popup window to appear on a click of a field, and I can return the session variable FROM the pop-up window, however I cannot figure out how to set the session variable based on the particular row chosen.
Any ideas? [sig]<p>John Vogel<br><a href=mailto:johnvogel@computerwiz.net>johnvogel@computerwiz.net</a><br><a href= Home Page</a><br>==---____Tri Tech Labs____---==<br>
¦¦ john@tritechlabs.com ¦¦<br>
==---------------------------==<br>
<br>
[/sig]
 
just an idea,
what if you give an ID to your each table row <tr> and trap it when you click on any row/definition....using DHTML or javascript..not sure.

 
Thanks for the reply. I have tried this. The problem is that by the time the trapping occures (OnClick), The database has allready looped through all of the data. Therefore, even if I gave the table rows ID's and used an OnClick, the actual DATA for that field is the last record read, not the current row. [sig]<p>John Vogel<br><a href=mailto:johnvogel@computerwiz.net>johnvogel@computerwiz.net</a><br><a href= Home Page</a><br>==---____Tri Tech Labs____---==<br>
¦¦ john@tritechlabs.com ¦¦<br>
==---------------------------==<br>
<br>
[/sig]
 
John,
When a click occurs, you can't get the event in your ASP code because the click is client side and ASP is server side. I would suggest using cookies instead, since you can access cookies from either server or client code.
[sig]<p>nick bulka<br><a href=mailto: > </a><br>[/sig]
 
Have a javascript function that acquires the clicked element value (window.event.srcElement) and then trigger an asp by submitting a form that does nothing but take the querystring or field name value and it then resets the session variable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top