JavaScript submit() stops working after removing an element from the page using JavaScript




10 years ago
a year ago


(Reporter: pekka.laiho, Unassigned)


1.9.1 Branch
Windows XP

Firefox Tracking Flags

(Not tracked)



(1 attachment)



10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv: Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv: Gecko/2009042316 Firefox/3.0.10 (.NET CLR 3.5.30729)

I have 2 javascript functions: one that calls form.submit() and one that dynamically removes one row from a table (a TR element). After removing the row, the submit() function stops working.

This was tested in FireFox 3.0.10 and 3.5b4 and seems to be broken in both. However it seems to work ok in IE6 and Google Chrome.

// submit-function:

// remove tr-function:
var table = document.getElementById("budjetti_table");
var row = document.getElementById(id);

Reproducible: Always

Steps to Reproduce:
Stated in the details-section.
Actual Results:  
Submit() function stops working.

Expected Results:  
Submit() should work normally after removing an element from the page.
Component: General → HTML: Form Submission
Product: Firefox → Core
QA Contact: general → form-submission
Version: unspecified → 1.9.1 Branch
Could be related to bug 586329, but this needs a testcase to be sure.

Comment 2

4 years ago
Description and solution to the problem:!topic/

Comment 3

3 years ago
Created attachment 8688747 [details]

Attaching a test case demonstrating the issue (test-case-2015-11-17.html).

Steps to reproduce:

1. Open test-case-2015-11-17.html.
2. Press “Save”. Observe form is submitted.
3. Re-open test-case-2015-11-17.html.
4. Press “Remove” to remove the button and its containing <div>.
5. Press “Save”. Observe form does not submit.

Occurs on:

- Firefox 42.0 on Mac OS X 10.10.5.
- Firefox 42.0 / Windows 7.

Does not occur on:

- Safari 9.0.1 / Mac OS X 10.10.5.
- Opera 33.0 / Mac OS X 10.10.5.
- Chrome 46.0.2490.86 / Mac OS X 10.10.5.


- Issue does not occur when `removeIt` is called from an event handler attribute. Issue does occur when `removeIt` is called from an event listener.
- Removing the call to `` resolves the issue.

Comment 4

3 years ago
One other note on test-case-2015-11-17.html: changing the <button>’s type attribute to “button” also resolves/works around the issue.

Comment 5

2 years ago
Thanks for the workaround Evan. I can confirm it with Firefox v53 -

Comment 6

2 years ago
can this bugs be solved or just we can closed it as incomplete?
You need to log in before you can comment on or make changes to this bug.