Bug 33513 - Submit form failed in onsubmit handler!
Summary: Submit form failed in onsubmit handler!
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL: http://www.sina.com.cn
Keywords: InRadar
Depends on:
Blocks: 39021
  Show dependency treegraph
 
Reported: 2010-01-11 21:41 PST by wesleyZeng
Modified: 2014-02-03 09:58 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wesleyZeng 2010-01-11 21:41:25 PST
If submitting a form in onsubmit handler, the submitting may be failed!
Bug's source: open www.sina.com.cn, loginin free email.

Test case like this:

<script>
function chkLogin(){
	
   document.showLogin.submit(); // note
   document.showLogin.password.value = "";

   return false;
}
</script>
	
<form name="showLogin" method="post" action="test.php" onsubmit="return chkLogin();" target="_blank"> 
UserName:<input type="text" name="username" value="" /><br>
Password:<input name="password" type="password" /><br>
<input type="submit" value="Login" /><br>
</form>

After chkLogin is executed, the password is empty and HTMLFormElement executes real submiting action after dispatching sumbit event, so the submitting failed.
Comment 1 Alexey Proskuryakov 2010-01-12 11:56:30 PST
See also: bug 11420, bug 13012.
Comment 2 Andy Estes 2013-02-20 01:46:32 PST
<rdar://problem/9655767>
Comment 3 Deepak Mittal 2014-02-03 02:22:31 PST
Hi,

I have checked this on the latest code, while choosing "Login" in the new window test.php will get loaded, and in the previous window Password field is empty, That is I think is intended behavior.


Please verify on latest and confirm..

Thanks