Welcome to WebmasterWorld Guest from 54.196.238.210

Forum Moderators: open

Message Too Old, No Replies

Populating a form in a popup from the parent webpage

     

scorpio

3:53 pm on May 14, 2003 (gmt 0)

10+ Year Member



Hi,

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

Raz

senior mcinvale

4:02 pm on May 14, 2003 (gmt 0)

10+ Year Member



yeah, do something like this:

vWindow = window.open('detail.php?field1=value1&field2=value2','Detail',style);

then in detail.php do this:

<?
echo "
<input type='text' name='field1' value='$_POST['field1']'>
<input type='text' name='field2' value='$_POST['field2']'>
";
?>

scorpio

12:13 pm on May 15, 2003 (gmt 0)

10+ Year Member



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.

Any ideas?

Cheers

senior mcinvale

2:44 pm on May 15, 2003 (gmt 0)

10+ Year Member



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....

 

Featured Threads

Hot Threads This Week

Hot Threads This Month