Page 1 of 1

Master/Detail PHP pop up window

Posted: Thu Jul 15, 2004 10:20 pm
by saltriver
This is what I want to do:
I have a Master/Detail page set made in PHP. I want the detail page to open up in a small pop up window.

From what I gather, the best way to make pop ups is with javascript. After redaing several posts in this forum and others, I'm still at a loss.

Here's where I'm at:

JS insert between the head tags:

Code: Select all

<script language="JavaScript">
 <!--
 function MM_openBrWindow(theURL,features) &#123; //v2.0
 window.open(theURL,features);
 &#125;
 //-->
 </script>


Link:

Code: Select all

<a href="javascript:" onClick="MM_openBrWindow('details.php?recordID=<?php echo $row_rsmd_cuisinea2&#1111;'restaurant']; ?>','width=200, height=200')"><?php echo $row_rsmd_cuisinea2&#1111;'restaurant']; ?></a><br>

So what is wrong with this?
Is it the "features"? Should I be using another word/command?

To see this page in action go to hungryburlington.com and search by cuisine.

Steve


feyd | Please use

Code: Select all

tags when posting non-php code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Thu Jul 15, 2004 10:26 pm
by feyd
:arrow: Window::open <-- method info..

What?

Posted: Thu Jul 15, 2004 10:48 pm
by saltriver
Where does that go? Does that replace the MM_openBrWindow in both parts?

Posted: Thu Jul 15, 2004 10:53 pm
by feyd
did you read the link?

Posted: Thu Jul 15, 2004 11:25 pm
by saltriver
Oops. Well I read it over and made a few changes (from MM_openBrWindow to window.open), but its still opening too big.
New JS function

Code: Select all

<script language="javascript">
<!--
function window.open(theURL,name,features);
//-->
</script>

New Link

Code: Select all

<a href="javascript:" onClick="window.open('details.php?recordID=<?php echo $row_rsmd_cuisinea2&#1111;'restaurant']; ?>','toolbar=yes,width=200,height=200')"><?php echo $row_rsmd_cuisinea2&#1111;'restaurant']; ?></a><br>

feyd | Please use

Code: Select all

tags when posting non-php code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Thu Jul 15, 2004 11:34 pm
by feyd
you can lose the function if you are using window.open directly, since it's a built-in method.

Code: Select all

<a href="javascript:" onClick="window.open('details.php?recordID=<?php echo $row_rsmd_cuisinea2&#1111;'restaurant']; ?>','','toolbar=yes,width=200,height=200')"><?php echo $row_rsmd_cuisinea2&#1111;'restaurant']; ?></a><br>

Posted: Thu Jul 15, 2004 11:53 pm
by saltriver
Feyd, quite simply...You rock!
Thank you so much!

It looks like I forgot the blank quotes for the name.

Thanks again.

Posted: Fri Jul 16, 2004 12:04 am
by feyd
sure thing.