If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

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

RESOLVED DUPLICATE of bug 97829

Status

()

Firefox
General
RESOLVED DUPLICATE of bug 97829
13 years ago
10 years ago

People

(Reporter: michael wimmer, Assigned: Blake Ross)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

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

Comment 1

13 years ago
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
Last Resolved: 13 years ago
Resolution: --- → INVALID
Resolution: INVALID → DUPLICATE
Duplicate of bug: 97829
You need to log in before you can comment on or make changes to this bug.