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

Upon Submission of Form -> Pop Window

by peacemaker1820 (Pilgrim)
on Jul 05, 2002 at 15:28 UTC ( #179659=perlquestion: print w/replies, xml ) Need Help??

peacemaker1820 has asked for the wisdom of the Perl Monks concerning the following question:

Hello There!
Upon Submission of my form I need to pop up a small window, where i have to use some values of the submitted form. Also upon submission I want my form page to stay, not go to the location in the action="url". In other words I want my pop up window to be the result of the submission of the form. How do I do that?
<br Thanks Brother-Monks

Replies are listed 'Best First'.
Re: Upon Submission of Form -> Pop Window
by CodeHound (Beadle) on Jul 05, 2002 at 15:50 UTC
    Indeed this is not related to perl, but i will try to help anyway... even if it gets deleted :p
    Hope my reply is not meant as a misdemeanor! A question is a question and i am eager to help since i feel fine today

    The main issue here is that you do not need to 'submit' the page to obtain the effect you want. Better, you need not do it!
    What you need is a button which, on 'onclick' calls a javascript routine that pops up on an href with a cgi script that receives the parameters you need.
    The sending page does not change, and the popup can perform any action you want. Especially if programmed in perl :)

    Again, I hope we do not upset anybody and ask excuses if so.

    update 1: like:
    ... <img src="bighotdogncolddrinkbutton.gif" onclick="javascript: openmypo +pup(document.hiddenfield1, document.hiddenfield2)"> ...
      an example for the javascript function:
      function submitit() { w_action=window.open('$self_url','action'); document.forms['main'].submit(); }
      and inside your form you can put:
      <INPUT TYPE=BUTTON value=submit onClick='submitit()'>
      I have taken this from a script I wrote some time ago, it is intended just to provide starting point.

      ---- kurt
      thanks
Re: Upon Submission of Form -> Pop Window
by zentara (Archbishop) on Jul 05, 2002 at 15:47 UTC
    Well the simplest thing to do is submit your form with the
    "target = _blank" statement. That will open a new window.
    <form action="http://myserver.com/cgi-bin/mycgi" method="post" target= +"_blank">
    A small window? I'm not sure, you might need to output
    some javascript code, which I totally avoid:-)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2020-12-03 19:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (57 votes). Check out past polls.

    Notices?