SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    On Submit, Open form results in new window?

    Hello:

    I have a form that visitors use to subscribe to my newsletter. I would like to set up the form (which calls a cgi script, the newsletter manager) so that when the user enters their email address and hits "submit", the form results (confirmation screen) opens in a new window rather than the main page. Does anyone know how I can do this?

    Thanks

    Mark

  2. #2
    SitePoint Member
    Join Date
    Aug 2002
    Location
    St. Louis, MO
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can just set the form's target to _blank. Or, if you want a specially sized window, you can open a window and set the target to that window via javascript:

    Code:
    window.open('about:blank', 'previewWin', 'width=555,height=300,resizable=yes,scrollbars=auto,menubar=no,toolbar=no,directories=no,location=no,status=no');
    document.formName.target = "previewWin";
    document.formName.submit();
    -GodOfHonk

  3. #3
    SitePoint Enthusiast plattopus's Avatar
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Judging by your post, you don't need a specific window size...

    Code:
    <form action="confirmation.php" method="post" target="_blank">
    
    form stuff goes here
    
    </form>
    This should work like a charm.

  4. #4
    SitePoint Member
    Join Date
    Sep 2002
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Those both worked great, thanks guys!

    Mark


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
  •