Closed Bug 269770 Opened 20 years ago Closed 1 month ago

Form submission fails and onSubmit fired, if still loading

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: harunaga, Unassigned)

References

()

Details

If we click submit button while the page is still loading, the form 
submission (sometimes) fails and onSubmit event handler is fired.

Testcase:
<SCRIPT type="text/JavaScript">
var submit_flag = false;
function onSubmit()
{
	if (submit_flag == true)
	{
		return false;
	}
	submit_flag = true;
	return true;
}
</SCRIPT>
<FORM onSubmit="if (onSubmit() == false) { return false; }" method="get" 
action="example.html">
	<INPUT type="submit">
</FORM>

Steps to reproduce:
1. Set security.warn_submit_insecure as false (to be able to reproduce
this easily)
2. Load the URL and save as "example.html".
3. Open the file, and repeat clicking the button as quickly as possible.

Actual Result:
in the meatimetime, the button becomes to do nothing.
JavaScript Debugger shows that "submit_flag" is true.
So onSubmit event handler has been fired.

Expected Result:
When a form isn't submitted, onSubmit event handler should not be fired.
Or when onSubmit is fired, the form should be submitted unless onSubmit 
returns false.

Confirmed with current-cvs/FreeBSD and 2004111207-trunk/Mac.
IE 6.0 doesn't have this problem.
Keywords: qawanted
I'd like form submission password population to take priority over loading the page completely.  

It appears that automatic form population waits until the page is loaded before the password is populated.
I'd like form submission password population to take priority over loading the page completely.  

It appears that automatic form population waits until the page is loaded before the password is populated.

This is especially noticeable on a slower connection.
It is now 2009 with FF 3.5.x and this problem still exist?  

All that is required to fire the form submission is a password field and hitting enter.  You don;t need a submit button nor returning FALSE on a OnSubmit() handler  will negate the submission.  This is wrong  behavior.
In response to Steve's 2006 comment. This is exactly what I am seeing, a password field takes precedence over javascript logic control.

Why is this not fixed after 3 years?
Assignee: form-submission → nobody
QA Contact: form-submission
WFM on:
Mozilla/5.0 (X11; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0

Can anyone still reproduce this issue?
Flags: needinfo?(harunaga)
Keywords: qawanted
Flags: needinfo?(sherfh)
Flags: needinfo?(sant9442)
Component: HTML: Form Submission → DOM: Core & HTML
Priority: -- → P5
Severity: normal → S3

The STRs are no longer valid; e.g. security.warn_submit_insecure is no longer used in the code base.

Please file a new bug with new STRs. Thanks.

Status: NEW → RESOLVED
Closed: 1 month ago
Flags: needinfo?(sherfh)
Flags: needinfo?(sant9442)
Flags: needinfo?(harunaga)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.