Closed Bug 272958 Opened 20 years ago Closed 20 years ago

A button tag inside a form tries to submit the form!.

Categories

(Firefox :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 97829

People

(Reporter: m.wimmer, Assigned: bugzilla)

References

()

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 A button tag inside a form tries to submit the form!. Reproducible: Always Steps to Reproduce: The page below tries to submit if the 'say huhu' button is pressed after the javascript alert is closed by pressing ok. It shows the same behaviour as the submit button (except for the additional javascript in the onclick event). <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled</title> </head> <body> <form name="FirefoxSearch" method="post" action="index.cfm"> <input type="text" name="test" value="" /> <input type="submit" name="submit" value="submit" /> <button onclick="alert('huhu');">Say HUHU</button> </form> </body> </html>
Expected behavior, we set the button type to Submit by default, as defined in HTML 4.01, and the event in your onclick does not return False, meaning we still execute default behavior. http://www.w3.org/TR/html4/interact/forms.html#h-17.5
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Resolution: INVALID → DUPLICATE
You need to log in before you can comment on or make changes to this bug.