Closed Bug 126708 (daft.ie) Opened 23 years ago Closed 21 years ago

daft.ie - Javascript on radio buttons causes continual loop processing click() events [daft.ie]

Categories

(Tech Evangelism Graveyard :: English Other, defect, P3)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gary, Unassigned)

References

()

Details

(Whiteboard: [eurocontest])

The radio buttons in the page http://www.daft.ie/search.daft are surrounded by 
an <a> tag which calls a function selectRadioButton().
This presumably is used to select the radio button if the text beside the 
button is clicked (it calls the click() method on the radio button).

However, the <a> tag surrounding the radio button is activated, causing a new 
call to selectRadioButton()

Steps to reproduce:
1. Click on any radio button or text beside the radio button on the page.

Result:
The window Javascript will infinitely loop, using a lot of CPU time - the 
window has to be closed.
Moving the <input type="radio"> tags outside the <a> tags seems to solve the 
looping problem - still needs to be tested against other browsers.
Whiteboard: [eurocontest]
Confirmed
2002022203/WinXP
Status: UNCONFIRMED → NEW
Ever confirmed: true
Confirming on 098 on WinXP. Also, the amount of memory used by Mozilla is
increasing slowly. Had to kill the process because trying to close the window
was not enough to get out of the loop. Therefore, this is more than an
evangelism bug, IMHO.
Setting P3 for Evangelism.
Status: NEW → ASSIGNED
Priority: -- → P3
Summary:

An A element with a javascript url contains a radio input element. The
javascript function that is called when the A element is clicked calls the click
method on the radio input element which causes the A element's click handler to
be fired again thereby causing an infinite loop.

I do not think this is correct behavior. ccing joki, jst and bz for help
Probably a dup of bug 77271.
Hmm..  Should calling .click() on a radio button fire the radio button's onclick
handler?  Because if it should, then our behavior is correct (the click event is
fired on the radio, is handled, is no cancelled, bubbles out, the <a> does not
check the target, etc).

I'm not sure whether programmatically calling .click() should dispatch an
onclick event, but it _looks_ like it should, from the DOM2 HTML spec...
Both IE and Mozilla fire onClick when the radio button is clicked; the spec
seems to support it.  The only real question is whether the event should bubble
to the A after having caused an action in the radio.  IE does not do it, and
that's why it works there.
*** Bug 158843 has been marked as a duplicate of this bug. ***
Alias: daft.ie
Summary: Javascript on radio buttons causes continual loop processing click() events → Javascript on radio buttons causes continual loop processing click() events [daft.ie]
it looks ok to me, I do not see any difference with IE, although I am not sure
to understand the decription of the bug.
Summary: Javascript on radio buttons causes continual loop processing click() events [daft.ie] → daft.ie - Javascript on radio buttons causes continual loop processing click() events [daft.ie]
New Component
Component: Europe: West → English Other
en other default owner
Assignee: nitot → english-other
Status: ASSIGNED → NEW
QA Contact: z-caillon-obsolete2 → english-other
The radio buttons in question are now surrounded by a <span> tag instead of an
<a> tag, so the problem does not occur.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.