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

RESOLVED DUPLICATE of bug 97829

Status

()

RESOLVED DUPLICATE of bug 97829
14 years ago
11 years ago

People

(Reporter: m.wimmer, Assigned: bugzilla)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 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

14 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: 14 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.