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

Need popup that pulls data from database

Status
Not open for further replies.

sharonc

Programmer
Joined
Jan 16, 2001
Messages
189
Location
US
I'm using Dreamweaver 4 mx, and SQL Server as database. I have three fields: Description, History, Action. I need the user to be able to click on each of these fields, one at a time and the data from the database is displayed in popup windows. Can someone tell me how to do this? Or if it can be done?
 
I'm used to using PHP as a programming language, but I would imagine you'd create the pop out window
Code:
javascript:pop();
and simply create the popout window as a hardlink with the database query and display within the page.

If you were creating the popout window dynamically, and didn't want to have 3 seperate pages, then you would have to make the link pass the variables to display from the database.

Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
Thank you for trying to help. I was able to create the popup window. So now I've moved on to other problems. I have a search that brings say two records. RecordID 1 and 2. RecordID 1 and 2 each have a popup for the field description. No matter wether I click on Recordid1 or 2, I receive the description for Recordid 1. I know I need to tell it which recordid description I want to see, but I can't figure out how. Any ideas?
 
you need to be passing the record id in the URL,
in php you'd be using something similar to
Code:
<a href=# onclick=openW("<?php echo $row_thumbnails['id']; ?>")> <?php echo $row_thumbnails['name']; ?></a>

what that is doing, is within a do while loop, and it outputs an array, enclosing the dynamically pulled from the database name inside href tags, which shows the id number for the name.

the javascript which makes this work is

Code:
<SCRIPT language="javascript">
function openW (id)
 {
 myWin=open ("details.php?detailsid="+id,"closerLook","scrollbars=yes,resizable=yes");
 }
</SCRIPT>

so the javascript is telling the link to produce the URL
details.php?detailsid= and the number from the id in the href tags around the name.

you then use the id passed in the url to query the database and get the records for that id.

this is based as I said on php, but most programming languages use a similar logic.

If that dosen't make any sense I'll try and explain it better.

Sometimes, when my code just won't behave, I take it outside and make it listen to britney spears music, and when it comes back it's really well behaved. I wonder if it's suffering from post tramatic stress syndrome now..
 
What language are you using? sharonc

[Peace][Pipe]
 
Thank you, I'll give this a try. I'm using VBScript and Java script. I'm pretty new to the arena. I wanted to use PHP on some things but my tech department can't figure out how to get perl to run on our server or how to access it. I can access on my work station, but that doesn't do much good for getting on the Intranet.
 
So your main page will have a recordset that pulls the 3 fields out. Highlight each one and use behaviours>Go To detail page passing the correct id for the new page to pull data out of the database.

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top