unable to pop to size from a submit function

Discussion in 'JavaScript' started by MyVodaFone, Sep 2, 2010.

  1. #1
    Could someone take a look at this, I am unable to get it to pop instead it just goes target _blank

    
    <script type="text/JavaScript">
    <!--
    function openWindow(theURL,winName,features) {
      window.open(theURL,winName,features);
    }
    //-->
    </script>
    </head>
    
    echo "
    <form action=confirm.php method=post id=popupWin target=formtarget onsubmit=openWindow('about:blank','formtarget','width=300,height=300')>
    
    <input type=hidden name=target value='$target'>
    <input type=hidden name=avatar value='$avatar'>
    <input type=hidden name=person value='$person'>
    </form>
    <script type=text/javascript>
    document.getElementById('popupWin').submit();
    </script>
    ";
    PHP:
    EDIT I was going to delete this because I found my solution, but thought it might be helpful for others.

    Forget about using a function, this was all I needed.
    
    <form action=\"confirm.php\" method=\"post\" name=\"popupWin\" target=\"popupWin\">
    <input type=hidden name=target value='$target'>
    <input type=hidden name=avatar value='$avatar'>
    <input type=hidden name=person value='$person'>
    <script type=text/javascript>document.popupWin.submit(window.open('http://domainName.com/confirm.php','popupWin','width=450,height=300,status=yes,resizable=yes,scrollbars=yes'));</script>
    </form>
    
    PHP:

     
    Last edited: Sep 2, 2010
    MyVodaFone, Sep 2, 2010 IP