Bug 126708 (daft.ie)

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

RESOLVED FIXED

Status

Tech Evangelism Graveyard
English Other
P3
major
RESOLVED FIXED
16 years ago
3 years ago

People

(Reporter: Gary Coady, Unassigned)

Tracking

Details

(Whiteboard: [eurocontest], URL)

(Reporter)

Description

16 years ago
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.
(Reporter)

Comment 1

16 years ago
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]

Comment 2

16 years ago
Confirmed
2002022203/WinXP
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 3

16 years ago
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

Comment 4

16 years ago
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

Comment 5

16 years ago
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...

Comment 7

16 years ago
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.

Comment 8

16 years ago
*** Bug 158843 has been marked as a duplicate of this bug. ***

Updated

16 years ago
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

Comment 11

15 years ago
en other default owner
Assignee: nitot → english-other
Status: ASSIGNED → NEW
QA Contact: z-caillon-obsolete2 → english-other
(Reporter)

Comment 12

15 years ago
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
Last Resolved: 15 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.