| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
|Accredited PayPal World Seller|
|Populating a form in a popup from the parent webpage|
| 3:53 pm on May 14, 2003 (gmt 0)|
I am developing in PHP,JS,HTML,MySQL.
I have a list of links on a page. Each link should call a JS function to 'pop' another window up to display more detail.
The JS code:
vWindow = window.open('detail.php','Detail',style);
The deatil depends on which link was clicked.
Is there any way of populating fields in the popup window (depending on the link clicked)from the parent . I've tried things like...
vWindow.document.field1.innerHTML = "The detail text";
vWindow.field1.innerHTML = "The detail text";
Does that make sense?
Could I do it by POSTing variables to the detail.php script and then the detail can be read from the database depending on the variable that was POSTed?
Thanks in Advance
| 4:02 pm on May 14, 2003 (gmt 0)|
yeah, do something like this:
vWindow = window.open('detail.php?field1=value1&field2=value2','Detail',style);
then in detail.php do this:
<input type='text' name='field1' value='$_POST['field1']'>
<input type='text' name='field2' value='$_POST['field2']'>
| 12:13 pm on May 15, 2003 (gmt 0)|
Thanks for the reply.
my code is:
vWindow = window.open('detail.php?x=00002','Detail',style);
I've called the php page as suggested, but when I reference the posted variable ($_POST['x']), it's empty.
| 2:44 pm on May 15, 2003 (gmt 0)|
hmmm, that is rather odd... pull up the properties on the pop-up and make sure that the 'x=00001' part is getting passed in the javascipt to the page...
other than that i dont have any good ideas, you can mail me with URLs and ill check it out if you like. i will need sample code as well....
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved