button does not submit when javascript calls submit then disables the button

RESOLVED DUPLICATE of bug 277890

Status

()

Firefox
General
--
major
RESOLVED DUPLICATE of bug 277890
13 years ago
13 years ago

People

(Reporter: Mike Willbanks, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050831 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b4) Gecko/20050831 Firefox/1.0+

This may be related to this bug: 284467 although I am not entirely sure, it
seems maybe that this one could either help track it down or it is seperate.

What happens is you have a form and in that form there is a button:
<button type="submit"
onclick="this.form.submit();this.disabled=true;this.innerHTML='Processing...'">Run</button>

What happens is that instead of the form submitting the form instead disables
the button and shows Processing...

It seems like javascript is not being allowed to submit a form, which in fact
would completely break the browser for most sites.  I have noticed this with
almost every Deerpark build (Note that this works as expected in Firefox 1.0)
and finally have had the time to report it.

If javascript was turned off this form would be handled still.  But with
javascript enabled and unable to submit the form it causes many problems.  I
could infact use the onsubmit to trigger the event but it takes away some
functionality. :)

Reproducible: Always

Steps to Reproduce:
1. Insert javascript code to submit a form, disable a button and replace the
Text on the inside of the button using the button element.
2. Fill out form and click the button

Actual Results:  
Button was disabled, the text was replaced but the form was never submitted.

Expected Results:  
The only different thing that should have been done is that the form should have
been submitted.

This problem may have come about after the new Javascript functions where
created.  Something to check into :)

Also an HTML test case:
<form action="http://www.mozilla.org">
<button type="submit"
onclick="this.form.submit();this.disabled=true;this.innerHTML='Processing...'">Go</button>
</form>
this.form.submit(); should be 

this.submit();
or
this.forms[0].submit();
(both work)

INVA ?
Certainly not: that should work, we're just a little screwed up with the
disabled event.

*** This bug has been marked as a duplicate of 277890 ***
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.