Can't check checkbox when within an <a href>




Event Handling
17 years ago
4 years ago


(Reporter: Tim Bornholtz, Unassigned)


(Blocks: 1 bug)

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)




17 years ago
In the following html I cannot check the checkbox.  If I click to check it, it
will take me to the href url.

<A HREF="">
<INPUT TYPE=checkbox NAME="myname" VALUE="myvalue">Click Me</A>

IE 5.5 will let me check the checkbox.  I know that this is bad HTML, but Lotus
Domino R5 generated it, so there is a potential to see this in the real world.

BTW, I'm using build 2000110804.
The HTML seems to be valid according to the HTML 4.01 spec.  From

Some events are specified as cancelable. For these events, the DOM
implementation generally has a default action associated with the event. An
example of this is a hyperlink in a web browser. When the user clicks on the
hyperlink the default action is generally to active that hyperlink. Before
processing these events, the implementation must check for event listeners
registered to receive the event and dispatch the event to those listeners. These
listeners then have the option of canceling the implementation's default action
or allowing the default action to proceed. In the case of the hyperlink in the
browser, canceling the action would have the result of not activating the hyperlink.

Cancelation is accomplished by calling the Event's preventDefault method. If one
or more EventListeners call preventDefault during any phase of event flow the
default action will be canceled.

Different implementations will specify their own default actions, if any,
associated with each event. The DOM does not attempt to specify these actions.

so the DOM spec also does not say anything one way or the other about Mozilla's
behavior in this case.  It seems to me that the user would expect
checking/unchecking the checkbox to take precedence over the link being
followed.  Confirming.  Over to event handling, since the checkbox should
prevent the event being bubbled to the link
Assignee: rods → joki
Component: HTML Form Controls → Event Handling
Ever confirmed: true
QA Contact: bsharma → lorca
Reassigning QA Contact for all open and unverified bugs previously under Lorca's
care to Gerardo as per phone conversation this morning.
QA Contact: lorca → gerardok

Comment 3

17 years ago
It's probably not too hard to make this work, although I think that this HTML is 
confusing at best.  If you look you'll notice that the checkbox does in fact 
change state, we just also load this link.  And since the checkbox is, in fact, 
inside the link, one has to wonder what the intent really is.  Unfortunately I 
think its not quite as simple as not bubbling the event, however, since code on 
the web page could be waiting for that event to bubble up and wonder why it's 
losing it.  For now I'm going to mark it future and if I have time I'll get back 
to it soon.

This bug has been marked "future" because the original netscape engineer
working on this is over-burdened. If you feel this is an error, that you or
another known resource will be working on this bug,or if it blocks your work
in some way -- please attach your concern to the bug for reconsideration.
Target Milestone: --- → Future
*** Bug 68659 has been marked as a duplicate of this bug. ***

Comment 5

17 years ago
Question, why put that inside <a></a> tags if it shouldn't trigger an event? 
Also, is there a single line written in W3C specs this should work at all?

Comment 6

17 years ago
QA contact updated
QA Contact: gerardok → madhur


16 years ago
QA Contact: madhur → rakeshmishra


15 years ago
QA Contact: rakeshmishra → trix

Comment 7

15 years ago
Assignee: joki → saari
QA Contact: trix → ian
Depends on: 127903
Blocks: 325652
*** Bug 197754 has been marked as a duplicate of this bug. ***


8 years ago
Assignee: saari → nobody
QA Contact: ian → events
Dell used to employ something like this on their website, was very annoying in Firefox. Thankfully they changed their system, so no worries there anymore...
This was _not_ fixed in bug 127903.  Smaug, I think we should just implement the html5 activation model to handle this....
Duplicate of this bug: 652813
OS: Windows 2000 → All
Hardware: x86 → All
You need to log in before you can comment on or make changes to this bug.