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 4 of 4

Thread: onSubmit

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post

    onSubmit

    I solved this before like 2 years ago on this forum, but I cannot find it in the archive.

    here is my problem, I need a popup window to honor the window attributes onsubmit but they aren't

    <form method="post" name="form1" action="http://www.iwon.com" target="myWin" onsubmit="window.open('','myWin','toolbar=no,status=no,location=no,menubar=no,scrollbars=yes,resizab le=no,width=250,height=250');return true;">
    ....
    </form>

    <script language="javascript">
    function forme()
    { document.form1.submit() }
    </script>

    <a href="#" onclick="forme()">Link</a>

    I know that the attributes default to no, this is just overkill. I thought that we figured there is just a problem doing this with the submit() function, but if I use an input button I should be fine. I cannot use an input button, all help is appreciated. Thanks
    I would rather be a lion for a day than a lamb that lives forever.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why not move the onsubmit code to your forme function?

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,048
    Thanks
    0
    Thanked 251 Times in 247 Posts
    calling document.form1.submit() won't fire the onsubmit event handler. just call window.open() before that, inside your forme() function as Roy said.

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Northern NJ
    Posts
    404
    Thanks
    0
    Thanked 1 Time in 1 Post
    not sure why I didn't think of that but that worked
    I would rather be a lion for a day than a lamb that lives forever.


  •  

    Posting Permissions

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