Bug 33513
Summary: | Submit form failed in onsubmit handler! | ||
---|---|---|---|
Product: | WebKit | Reporter: | wesleyZeng <weihong.zeng> |
Component: | DOM | Assignee: | 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
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 | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Alexey Proskuryakov
See also: bug 11420, bug 13012.
Andy Estes
<rdar://problem/9655767>
Deepak Mittal
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