Results 1 to 4 of 4

Thread: Open new window(submit)

  1. #1
    Join Date
    Nov 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Open new window(submit)

    Can you help me with form, when click submit.
    I would like creat form, when i click submit open new window, but when I insert before submit (onclick="myOpenWindow()) the script function Validator does not function.

    Code:
    <script language="JavaScript"><!--
    buttonClicked=false;
    function myOpenWindow() {
        myWindowHandle = window.open('about:blank','myWindowName','resizable,status,scrollbars=yes,width=100,height=200,top=0,left=0');
    }
    //--></script>
    
    <form id="Rezervace_vozidla" name="Rezervace_vozidla" style="position: absolute; left: 9px; top: 365px;" action="Rezervace_vozidla_handler.php" method="get" target="myWindowName" onsubmit="if (!buttonClicked) ;">
    
    
    <input type="submit" id="Odeslat" name="Odeslat" style="width: 85px; height: 19px;" class="button" onclick="myOpenWindow (); buttonClicked=true; setTimeout('document.myForm.submit()',500);return false;" value="ODESALT"></div>

    Thank you

    Michal
    Last edited by jscheuer1; 11-11-2007 at 03:17 PM. Reason: add code tags

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Please format any code in your post using the CODE tag. This makes it a lot easier to read it.

    Hmm I'm confused what you're trying to do here- submit a form while opening a pop up window, or actually submit the form so the returned result shows up in a pop up instead (similar to this script)?

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

  4. #4
    Join Date
    Apr 2010
    Location
    Lake Charles, LA
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by nmajkl View Post
    Can you help me with form, when click submit.
    I would like creat form, when i click submit open new window, but when I insert before submit (onclick="myOpenWindow()) the script function Validator does not function.

    Code:
    <script language="JavaScript"><!--
    buttonClicked=false;
    function myOpenWindow() {
        myWindowHandle = window.open('about:blank','myWindowName','resizable,status,scrollbars=yes,width=100,height=200,top=0,left=0');
    }
    //--></script>
    
    <form id="Rezervace_vozidla" name="Rezervace_vozidla" style="position: absolute; left: 9px; top: 365px;" action="Rezervace_vozidla_handler.php" method="get" target="myWindowName" onsubmit="if (!buttonClicked) ;">
    
    
    <input type="submit" id="Odeslat" name="Odeslat" style="width: 85px; height: 19px;" class="button" onclick="myOpenWindow (); buttonClicked=true; setTimeout('document.myForm.submit()',500);return false;" value="ODESALT"></div>

    Thank you

    Michal
    I found this on a forum the other day and I use First Page 2000 for my html editor. This uses their button form and it works.
    <form><input type="button" value="Any site name" onclick="window.open('http://www.any_site.htm','_blank');"></form>
    There is no script needed except for their button form. I just replaced what they had with this.

    Vern
    Last edited by vwells02; 04-17-2010 at 05:00 PM. Reason: forgot my name

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
  •