CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
creating pop up window with script results



Feb 16, 2001, 9:52 AM

Post #1 of 2 (358 views)
creating pop up window with script results Can't Post

I have a search script that I downloaded and have running for a phone list of employees in my company.
The script consist of 3 parts. A search html page, the actual cgi script, and a results html template page. I have the script working fine. My questions is how to tell the script that I want the result/template page to come up in a small popup window, not replace the existing page? I plan on putting the search html in a small frame at the top of the page, and do not want the results to appear in the small frame. Any help would be greatly appreciated.


Feb 16, 2001, 11:53 AM

Post #2 of 2 (357 views)
Re: creating pop up window with script results [In reply to] Can't Post

You'll have to use javascript.

In the head of your search page add this,

<SCRIPT language="JavaScript">
function openwin(URL, width, height) {
var now = new Date();
var remote =, "popup" + now.getTime(), "width=" + width + ",height=" + height + ",top=0,left=0,toolbar=1,location=0,directories=0,resizable=1,status=0,menubar=0,scrollbars=1");
// -->

You can change the popup window's feautures by playing with the variables there.

Now in your form,

<form action="" method="Your Method" onsubmit="openwin('' +, 500, 250); return false;" name="form">

I assume you will switch "searchterm" with the name of the search boc in your search page.

Let me know if you have problems with that. Well, if you do, instead of putting the onsubmit="blabla" in the <form> tag, put in in the submit button, <input type="submit" onclick="that other stuff">

Also if you put in into the submit button, you'll have to change "this.form" to "document.form".

Be sure to add name="form" in the <form> tag.

Hope that's not TOO confusing.



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives