[SOLVED] Master/Detail PHP pop up window

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
saltriver
Forum Commoner
Posts: 59
Joined: Fri Mar 12, 2004 2:40 pm
Location: Burlington, VT

Master/Detail PHP pop up window

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

:arrow: Window::open <-- method info..
saltriver
Forum Commoner
Posts: 59
Joined: Fri Mar 12, 2004 2:40 pm
Location: Burlington, VT

What?

Post by saltriver »

Where does that go? Does that replace the MM_openBrWindow in both parts?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

did you read the link?
saltriver
Forum Commoner
Posts: 59
Joined: Fri Mar 12, 2004 2:40 pm
Location: Burlington, VT

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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>
saltriver
Forum Commoner
Posts: 59
Joined: Fri Mar 12, 2004 2:40 pm
Location: Burlington, VT

Post by saltriver »

Feyd, quite simply...You rock!
Thank you so much!

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

Thanks again.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

sure thing.
Post Reply