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="http://www.mozilla.org"> <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 http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-flow-cancelation: ------------- 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
Reassigning QA Contact for all open and unverified bugs previously under Lorca's care to Gerardo as per phone conversation this morning.
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.
*** Bug 68659 has been marked as a duplicate of this bug. ***
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?
QA contact updated
13 years ago
12 years ago
*** Bug 197754 has been marked as a duplicate of this bug. ***
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....