Bug 22091 - Can't submit multiple forms via JavaScript
Summary: Can't submit multiple forms via JavaScript
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac (Intel) OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 39021
  Show dependency treegraph
 
Reported: 2008-11-05 16:16 PST by Jamie Raut
Modified: 2011-08-24 11:14 PDT (History)
2 users (show)

See Also:


Attachments
The example HTML & JavaScript (647 bytes, text/html)
2008-11-05 16:17 PST, Jamie Raut
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jamie Raut 2008-11-05 16:16:39 PST
Simple page, two iframes, two forms, each form targets an iframe. Trying to submit both forms simultaneously via JavaScript will result in only the first form being submitted, the second submit is ignored apparently.

The below functions as expected in Firefox 3.0.3 on Mac Intel OS X 10.5. The second form submission fails when tested on the webkit nightly build from Nov 4 2008 (Version 3.1.2 [5525.20.1] in About Safari...), same OS/platform.

<html>
  <head>
    <script type="text/javascript">
      function submitBoth() {
          document.getElementById('form1').submit();
          document.getElementById('form2').submit();
      }
    </script>
  </head>
  <body>
    <form id="form1" method="get" target="frame1" action="http://images.google.com/images">
	  <input type="hidden" name="q" value="iced coffee"/>
    </form>
    <form id="form2" method="get" target="frame2" action="http://isiticedcoffeeweather.com/">
    </form>
    <iframe name="frame1"></iframe><br/>
    <iframe name="frame2"></iframe><br/>
    <a href="javascript:submitBoth()">Submit 'em!</a>
  </body>
</html>
Comment 1 Jamie Raut 2008-11-05 16:17:30 PST
Created attachment 24925 [details]
The example HTML & JavaScript
Comment 2 Mihai Parparita 2011-08-23 14:04:59 PDT
This appears to work in Safari 5.1
Comment 3 Alexey Proskuryakov 2011-08-24 11:08:55 PDT
Mihai, should a regression test be landed for this?
Comment 4 Mihai Parparita 2011-08-24 11:12:55 PDT
(In reply to comment #3)
> Mihai, should a regression test be landed for this?

It can't hurt.
Comment 5 Mihai Parparita 2011-08-24 11:14:39 PDT
Actually, I think http://trac.webkit.org/browser/trunk/LayoutTests/fast/events/popup-when-select-change.html is already testing for this (onpopup is submitting two forms, each targetted at a different iframe).