Bug 33513

Summary: Submit form failed in onsubmit handler!
Product: WebKit Reporter: wesleyZeng <weihong.zeng>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: aestes, ap, ddkilzer, deepak.deepakmittal, dglazkov
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
URL: http://www.sina.com.cn
Bug Depends on:    
Bug Blocks: 39021    

wesleyZeng
Reported 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.
Attachments
Alexey Proskuryakov
Comment 1 2010-01-12 11:56:30 PST
See also: bug 11420, bug 13012.
Andy Estes
Comment 2 2013-02-20 01:46:32 PST
Deepak Mittal
Comment 3 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
Note You need to log in before you can comment on or make changes to this bug.