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

pass database values to popup window

Status
Not open for further replies.

sharonc

Programmer
Jan 16, 2001
189
US
Using asp and Javascript (in Dreamweaver):
I have a window that displays all the data in a database record with a popup button to display the description field.
The window displays the data for record 7, when I click on on the popup button, the description field is displayed for record 1, the first record in the database, not the record 7, I'm currently on.

<td><strong><font size="5"><img src="../IMAGES/Description.gif" alt="Click Here" width="91" height="33" border="0" Onclick="MM_openBrWindow('
How do I get it to show the description for the record I'm viewing record 7?
 
You need to pass the record id with it:
Code:
<td><strong><font size="5"><img src="../IMAGES/Description.gif" alt="Click Here" width="91" height="33" border="0" Onclick="MM_openBrWindow('[URL unfurl="true"]http://seims/projects/ApacheProjects/Description.asp?id="&recordID','Description','status=yes,scrollbars=yes,resizable=yes,width=400,height=300')">[/URL]

Then in the popup, you load the record description like this:

Code:
sql = "select description from myTable where id=" & Request.QueryString("id")
 
Thank you for your quick response. Where do I tell it what the value is for &recordid?
 
or you could assign it to a session variable if you're using them or a cookie,then just pull that when the window is opened and have less to pass via url, also helps in preventing caching of the pop up page just in case.

[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top