Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating a popup and posting to the new window

    Hi I wonder if it's technicaly possible to achive the following behavior using Javascript. Imagine a form using post. When you hit the submit of this form a popup is created which all the data gets posted to.

    Thankful for any replies!

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts
    HTML:
    Code:
    <form action="blah.asp" method="post" target="mypopup" onsubmit="openPopup(this.target)">
    ...
    <input type="submit" value="Submit" name="btnSubmit" />
    </form>
    Javascript:
    Code:
    function openPopup(target){
      var w = window.open('', target, 'width=600, height=500, resizable=1');
      w.focus();
    }
    If you want a normal popup window with address and menu bar visible and no pre-set size and location, then you just specify target="_blank" in the form tag and no scripting needed.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #3
    New to the CF scene
    Join Date
    Jan 2006
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Forgot my login info so couldn't thank you right away.

    Thanks for the help, worked perfectly.


  •  

    Posting Permissions

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