Closed Bug 431445 Opened 17 years ago Closed 3 years ago

Can't call form.submit() inside document.onunload handler

Categories

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

x86
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 356923

People

(Reporter: brett, Unassigned)

References

()

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14 If you have a document.unload() handler, which calls into the current page's dom and tries to submit a form, the javascript runs with no errors, but the form never gets submitted. In the example link above, the form should submit when clicking the url 'Exit Page'. Reproducible: Always Steps to Reproduce: 1. Create a page with a form on it 2. Create a document.unload handler 3. inside the handler, call document.forms[0].submit() 4. Note forms[0] never gets submitted. Actual Results: Form wasn't submitted Expected Results: The form should either submit, or an explicit javascript error should be raised.
Related to bug 356923?
Summary: Can't call form events inside document.onunload handler → Can't call form.submit() inside document.onunload handler
Attached file Test case (deleted) —
Added the test case as an attachement. Click the 'Exit Page' link. Note the 'kavi_form' isn't submitted.
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
Alternate solution is to use onBeforeunload. It will work.
Status: UNCONFIRMED → NEW
Ever confirmed: true
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: