Form submission fails and onSubmit fired, if still loading

RESOLVED INACTIVE
(Needinfo from 3 people)

Status

()

Core
HTML: Form Submission
RESOLVED INACTIVE
14 years ago
2 days ago

People

(Reporter: HARUNAGA Hirotoshi, Unassigned, NeedInfo)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
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.

Comment 1

13 years ago
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.

Comment 2

13 years ago
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.

Comment 3

9 years ago
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.

Comment 4

9 years ago
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

Comment 5

5 years ago
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

Updated

5 years ago
Flags: needinfo?(sherfh)

Updated

5 years ago
Flags: needinfo?(sant9442)

Comment 6

2 days ago
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Last Resolved: 2 days ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.