Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parent spawns child, child reads db in perl, child transfers to parent

Status
Not open for further replies.

iggit

Programmer
May 20, 2001
47
US
I have this problem....
I have a button opening a 100x100 popup that when accessed
grabs a number assigned to a field through the perl script.
It places the number from the perl script into a hidden field.
I need it to transfer that number to a text box in form name=mainform input name=gotnumber and close as soon as it does it.
I can open the window and access the script but I don't know how to grab the number and send it to the parent window form element automatically. Closing it is no problem.
Your assistance will as always be graciously appreciated.
 
Or can I just grab the perl script from the form and insert the value into the text field? Without having to spawn a new window to get it done?
Or is that too much?
 
Could you generate the original page that opens the popup (that needs this number) in perl? You could simply have it call/do what this other perl script does at the top, then print the rest of the html page as-is, including the new information where needed. ----------------------------------------------------------------------------------
...but I'm just a C man trying to see the light
 
I wish I could. But the number is a series number not assigned unless the function being done on the page is creating a new database entry. Other functions are on the page as well so I can't preload a number and I can't refresh the page. Have to get it from an outside source and implant it to the form in the parent.
 
Here is what I am using so far:
In the parent <head></head> is
<SCRIPT LANGUAGE = &quot;javascript&quot;>
var theURL = 'rollowadmin.cgi?function=getnumber';
var width = 100;
var height = 100;
function popWindow() {
newWindow = window.open(theURL,'newWindow','toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width='+width+',height='+height);
}
</script>
Child window is opened.
Then the child has:
<html><head><title>GET NUMBER</title>
<script>
var howLong = 1000;
t = null;
function closeMe(){
t = setTimeout(&quot;self.close()&quot;,howLong);
var gamenumber = $gamenumber; //assigned by perl
}
</script>
</head>
<body onload=&quot;closeMe();self.focus()&quot;>
<form name=transfer><input type=hidden name=gamenumber value=&quot;$gamenumber&quot;></form>
</body>
</html>
Opens nicely, shows number in hidden field then closes.
But it has to send the cotton pickin number to the parent first.
 
Thank you for your input and review but I'm solving this in a completely different way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top