Open Bug 430105 Opened 16 years ago Updated 5 months ago

Form inputs inside anchor tags are clickable to link, not to edit

Categories

(Core :: DOM: Events, defect, P3)

defect

Tracking

()

People

(Reporter: sparr0, Unassigned)

References

(Blocks 1 open bug, )

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.11) Gecko/20071204 Ubuntu/7.10 (gutsy) Firefox/2.0.0.11

A form input inside an <a> follows the link when it is clicked, instead of allowing text to be entered.  I think that this is non-intuitive and probably undesired behavior.

Sample code:
<a href="http://www.google.com"><input></a>

Reproducible: Always

Steps to Reproduce:
Visit URL, click on waiver name input.
Actual Results:  
(broken) link is followed

Expected Results:  
focus enters text box
I have a strong feeling this bug is invalid, but I can't find the exact reference in the HTML specification. But I have a feeling that everything in between <a href="http://www.google.com"> and </a> should be a link to http://www.google.com. Giving the author full control over any item that the author wants to make a link. 

http://www.w3.org/TR/html401/struct/links.html
...
The default behavior associated with a link is the retrieval of another Web resource. This behavior is commonly and implicitly obtained by selecting the link (e.g., by clicking, through keyboard input, etc.).
...
By activating these links (by clicking with the mouse, through keyboard input, voice commands, etc.), users may visit these resources.
...

The xhtml and html5 specs don't seem to have anything to say on the matter.

I think it is left up to the user agent precisely how and under what conditions to activate a link, and I reiterate that the behavior currently in FF2 is counterintuitive.

"Fixing" this would unfortunately remove an element of author control, in the rare case that the current behavior is desired, but this could be worked around with an onclick event for the input.
I can confirm this behavior on Fx3 on Windows. Not sure I agree, but I can confirm it. I'd try and get the attention of an appropriate Mozilla developer if you feel pretty strongly about it.
Status: UNCONFIRMED → NEW
Component: General → DOM: Events
Ever confirmed: true
OS: Linux → All
Product: Firefox → Core
QA Contact: general → events
Hardware: PC → All
Version: unspecified → Trunk
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
See Also: → 1658315
Severity: minor → S4
Blocks: 1459231
Severity: S4 → S3
Priority: P5 → P3
You need to log in before you can comment on or make changes to this bug.