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 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2003
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HowTo post form using text link to popup window & resize popup

    Please, someone help....this is what I have and it isn't working. The form will post, it will open the popup window, but it will not honor the width, height and scrollbar commands. Any Advice?

    <head>
    <script>
    function formpopup()
    {
    window.open('about:blank','formWin','width="435",height="285",scrollbars="no"');
    return true;
    }

    </script>
    </head>

    <body>
    <form name=myform action="user.asp"
    method="get" target="formWin"
    onsubmit="return formpopup()">
    <input type="hidden" name="userid"
    value="1">
    <p><a href="javascript:document.myform.submit();">Submit Me</a></p>
    </form>
    </body>

  • #2
    New Coder
    Join Date
    Dec 2003
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Firstly, you have used the quotes wrong. Secondly, there is a problem with the a href and the onsumbit properties. Something like this should work:

    <head>
    <script>
    function formpopup()
    {
    window.open("about:blank","formWin","width=435,height=285,scrollbars=no");
    return true;
    }
    </script>
    </head>

    <body>
    <form name=myform action="user.asp"
    method="get" target="formWin"
    onsubmit="javascript:document.myform.submit();">
    <input type="hidden" name="userid"
    value="1">
    <p onClick="formpopup()">Submit Me</p>
    </form>
    </body>


    Hope this helps

    Murdz
    Spiral Out

  • #3
    New Coder
    Join Date
    Oct 2003
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hmmm, still not working

    You gave really good advice, but it still isn't quite there yet. I made those changes, and when I click on the "Submit Me" text, it will open a window, the correct size, but the window is blank and is not displaying the proper URL....

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Posts
    698
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Perhaps something like this?

    Code:
    <head>
    <script>
    function formpopup()
    {
    window.open("about :blank","formWin","width=435,height=285,scrollbars=no");
    return true;
    }
    </script>
    </head>
    
    <body>
    <form name=myform action="user.asp" 
    method="get" target="formWin" 
    onsubmit="formpopup();">
    <input type="hidden" name="userid" 
    value="1">
    <p onClick="document.myform.submit();">Submit Me</p>
    </form>
    </body>

  • #5
    New Coder
    Join Date
    Oct 2003
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Garadon, almost, but popup will not resize

    the asp page, also has code in it to display information from a database based upon the hidden userid field. With Garadon's script, it does this in a popup, but it still will not resize the popup. I have tried the following and it is working, but first it is loading in the popup a blank page (about:blank) is showing up in the title bar, then a few seconds later it is displaying the correct asp page with the userid field passed. I have tried removing the "about:blank" in the javascript, but that will not work. Still not sure if this is as clean as I can get this script or not?

    <head>
    <script>
    function formpopup()
    {
    window.open("about:blank","formWin","width=435,height=285,scrollbars=no");
    return true;
    }

    </script>
    </head>

    <body>



    <form name=myform action="security.asp"
    method="get" target="formWin"
    onclick="javascript:document.myform.submit();">
    <input type="hidden" name="userid"
    value="1">
    <p onclick="javascript:formpopup();">Submit Me</p>
    </form>

    </body>


  •  

    Posting Permissions

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