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!

open pop up window and show details of a record

Status
Not open for further replies.

mrsbean

Technical User
Joined
Jul 14, 2004
Messages
203
Location
US
I have been tinkering with pop up windows and javascript. I got the javascript window working great in general, but I'm having trouble getting a variable to work with it.

Here is the script in the <head> tag of the html:
Code:
<script language="JavaScript">
function launch(){
win=window.open("viewContactInfo.php?thisID=<? echo $wsuaaID; ?>", (break for readability)
"ViewContacts","width=250,height=400,top=50,left=50, (break for readability)
resizable=YES,scrollbars=NO,menubar=NO,toolbar=NO,status=NO,location=NO")}
</script>

Here is the link
Code:
<a href="javascript:launch()">View Contacts</a>

I'm not attached to any method of accomplishing what I want. I need to create a small pop up window which displays details of a particular record. The links to the View Contact information are generated via PHP.

What I get is the small contact window without a record loaded in it. If I dump a fully addressed link into a browser window, such as


I get what I want, but it's not in the small pop up that I'm seeking. The number at the end of the link is a variable.

I'm more familiar with PHP than javascript, so if there is some "wordy" way of doing this that I can dump into my code using PHP, that's fine.

MrsBean
 
Right-click on the pop-up window that doesn't display the record you want and check out its properties, specifically look at the URL to see if the ID is being passed in. Make sure your PHP ID variable is named correctly. Also, I would use the following, instead of echo:
Code:
<script language="JavaScript">
    function launch()
    {
        [...]<?php print(($wsuaaID); ?>[...]
    }
</script>

Take Care,
Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top