SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to submit form and make TWO pages appear?

    I would like to submit a form, and then have a results page appear... but also a small popup with another webpage.

    Is this possible?

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi hstraf,

    Code:
    <html>
    <head>
    <script type='text/javascript'>
    var myWin=null;
    function winOpen(url) {
      if (myWin && !myWin.closed) {
        myWin.location.href = url;
      }
      else {
        myWin = window.open(url, 'myWin');
      }
    }
    function doSubmit() {
      winOpen('http://...');
      return true;
      // return false to cancel submission
    }
    </script>
    </head>
    <body>
    <form name='f1' action='...' method='...' onsubmit='return doSubmit();'>
    User <input type='text' name='user' value=''><br>
    Amount <input type='text' name='amt' value=''><br>
    Description <input type='text' name='desc' value=''><br>
    <input type='submit' value='GO'>
    </form>
    </body>
    </html>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •