RE: [PHP] Passing variables back to parent window
| From: | Wayne Joyner | Date: | Thu, 14 Dec 2000 20:18:36 +0000 |
| Subject: | RE: [PHP] Passing variables back to parent window | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30355@lists.php.net to get a copy of this message | ||
Here is a function I am using to do a similar thing. I need to parse the
database for a client location and let the user select an entry from a
seperate window, then return to the original page.
<snip>
<?php
// PHP funtion to lookup customer location using child window
function LocLookup() {
ii = document.ProjReq.client_id.selectedIndex;
val = document.ProjReq.client_id.options[ii].value;
myURL = 'PREntryLoc.php?client_id=' + val;
loc = window.open(myURL, 'myloc',
'scrollbars=no,width=400,height=200,resizable=yes');
loc.focus();
}
?>
<snip>
----------------------------------------------------------------------------
-----------------------------------------------
This section is within the original code calling the child page.
<!-- Display Customer Entry Data -->
<table width='65%' bgcolor="#ccffff" border="3"
bordercolor="Black"
cellpadding='5' cellspacing='10'>
<tr>
<td colspan='1'><a <? echo $childWindow; ?>
href="PCMOProjReqHelp.html#CustomerName" onMouseOver="describe('Select
Customer Name from Drop Down List. Click here for additional help.'); return
true;" onMouseOut="clearstatus();"><?echo $RedFont; echo "*
";?></font><?echo $LNFont;?>Customer(SYS/PRIN):</font></a>
<td colspan='1'><? $qry = "SELECT client_id, MSO+'
('+sys+'/'+prin+')'
FROM client ORDER BY MSO, sys, prin"; $cli[0] = " "; $cli[99999999] = "CSG
Internal"; $cli += $et->GetCol( $qry ); $form->Select("client_id", $cli, 1,
FALSE, $client_id, "LocLookup();")?>
<!-- Display Customer Location Entry -->
<tr>
<td colspan='1'><a <? echo $childWindow; ?>
href="PCMOProjReqHelp.html#Location" onMouseOver="describe('Do not attempt
to change this field. Your request submission will fail! Click here for
additional help.'); return true;" onMouseOut="clearstatus();"><?echo
$RedFont; echo "* ";?></font><?echo
$LNFont;?>Location:</font></a>
<td colspan='1'><? $form->Input("Loc_Display", 37, 250,
$Loc_City); echo
"<br>"; echo "<font size='-1' color='Black'><i>
Do not attempt to change
this field. Your request submission will fail!</i></font>";?> <?
$form->Hidden("site_id", $site_id); ?>
</table>
----------------------------------------------------------------------------
--------------------------------------------
Unfortunately I have not found a solution that will allow me to do this in a
way that the user can't physically type something into the field. Anytime
they do this SUBMIT fails! Anyone got a better idea? I can't refresh the
page. Too many other calls to the database for drop-down list boxes before
getting to this point in the page development. 3 of the drop down list boxes
alone have over 1000+ records each (Customer Data, Requestor, Originator).
Refresh would be too time consuming and take up a lot of Intranet bandwidth.
Its' bad enough now!
Obviously, this code is pretty complicated with some formatting, but picking
through it should give you a fairly good idea of how to pop open a seperate
window, select some data, and return to the original form.
Wayne Joyner
CSG Systems, Inc.
2525 N. 117th Avenue
Mail Stop 1-TSC
Omaha, NE
(402) 431-7138
> -----Original Message-----
> From: Josh G [mailto:josh@gfunk007.com]
> Sent: Wednesday, December 13, 2000 7:51 PM
> To: php-general@lists.php.net; scott@globalhost.com
> Subject: Re: [PHP] Passing variables back to parent window
>
>
> <script language="JavaScript">
>
> window.parent.location="something.php?something=<?php echo $someval; ?>";
>
> </script>
>
> or it may be window.parent.document.location, not sure, since I'm
> doing this
> off the top
> of my head :)
>
> Gfunk
>
> http://www.gfunk007.com/
> ----- Original Message -----
> From: <scott@globalhost.com>
> To: <php-general@lists.php.net>
> Sent: Thursday, December 14, 2000 12:43 PM
> Subject: [PHP] Passing variables back to parent window
>
>
> > Hello all,
> >
> > I have a window that pops up another window to do a search for
> users in a
> database. I want to be able to send the user's username back to the parent
> window as a variable. Anybody know how this would be done?
> >
> > Thanks,
> > - - - - - - - - - - - - - - -
> > Scott Poarch
> > http://www.globalhost.com
> > - - - - - - - - - - - - - -
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
>
>