Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl output to new browser window?

by Anonymous Monk
on May 02, 2003 at 20:14 UTC ( [id://255150]=note: print w/replies, xml ) Need Help??


in reply to Perl output to new browser window?

Ok thanks for your comments.

But I am now very confused I found the below code @
http://www.wiley.com/legacy/compbooks/stein/source.html

Which runs a perl script opening a pop window?
So could you clear up my confusion please?
Can I use CGI.pm or not?
Regards
Gareth

#!/usr/bin/perl #file: frames.pl use CGI qw/:standard/; print header, start_html('Popup Window'); if (!param) { print h1("Ask your Question"), start_form(-target=>'answer'), "What's your name? ",textfield('name'), p(), "What's the combination?", checkbox_group(-name=>'words', -values=>['eenie','meenie','minie','moe'], -defaults=>['eenie','moe']), p(), "What's your favorite color? ", popup_menu(-name=>'color', -values=>['red','green','blue','chartreuse']), p(), submit, end_form; } else { print h1("And the Answer is..."), "Your name is ",em(param(name)), p(), "The keywords are: ", em(join(", ",param('words'))), p(), "Your favorite color is ",em(param('color')); } print end_html;

Replies are listed 'Best First'.
Re: Re: Perl output to new browser window?
by pfaut (Priest) on May 02, 2003 at 22:10 UTC

    The key line there is start_form(-target=>'answer'). The 'target' attribute tells the browser which window to display the response in. If a window with the specified name doesn't exist, a new window will be created.

    90% of every Perl application is already written.
    dragonchild

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://255150]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-04-25 12:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found