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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



flanman
Novice

Feb 16, 2001, 9:52 AM

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

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



sleuth
Enthusiast

Feb 16, 2001, 11:53 AM

Post #2 of 2 (297 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 = window.open(URL, "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");
remote.focus();
}
// -->
</SCRIPT>

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

Now in your form,

<form action="http://www.path.com/yourscript.pl" method="Your Method" onsubmit="openwin('http://www.path.com/yourscript.pl?searchterm=' + this.form.search.value, 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.

Tony


 
 


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

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