Closed Bug 435607 Opened 16 years ago Closed 16 years ago

If a link is placed inside of a label tag with an input submission button, which it shouldn't be, <br>the link will submit the form if the href attribute of the link contains a javascript request.

Categories

(Firefox :: General, defect)

x86
Windows Vista
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 163912

People

(Reporter: sickbeatz, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008051206 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9) Gecko/2008051206 Firefox/3.0

If a link is placed inside of a label tag with an input submission button, which it shouldn't be, the link will submit the form if the href attribute of the link contains a javascript request. If the href attribute is not javascript, the form does not submit. Here is a sample:

<html>
<head><title>Firefox 3rc1 label bug</title>
</head><body>

<h1>Firefox 3rc1 label bug</h1>
<p>If a link is placed inside of a label tag with an input submission button, which it shouldn't be,
<br>the link will submit the form if the href attribute of the link contains a javascript request.</p>

<form action="destination.php">

	<label>
	<input type="submit" name="button" id="button" value="Submit">
	<a href="javascript:void(0);">Link that should do nothing</a>
	</label>

</form>

</body>
</html>


Reproducible: Always

Steps to Reproduce:
1. Create a form
2. Create a label with a submit button and a link (bad code)
3. Make the href attribute for the link a javascript request
4. Click the link
Actual Results:  
The form is submitted.

Expected Results:  
The javascript request should fire off instead of the form submission.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.