Closed Bug 48000 Opened 24 years ago Closed 24 years ago

onclick handler of radio buttons runs before clicked set

Categories

(Core :: DOM: Core & HTML, defect, P3)

x86
Linux
defect

Tracking

()

VERIFIED DUPLICATE of bug 42972

People

(Reporter: andrew, Assigned: jst)

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16errata i686; en-US; m17) Gecko/20000807
BuildID:    2000080712

The onclick handler of radio buttons runs before the radio button is marked
clicked.  This is a change in behavior from NS4 (and I think from IE).

Reproducible: Always
Steps to Reproduce:
1. Load this page:

<form>
<input type=radio name=bar value=1 onclick="
    alert(this.checked ? 'yes' : 'no');">
<input type=radio name=bar value=2 onclick="
    alert(this.checked ? 'yes' : 'no');">
</form>

2. click radio buttons


Actual Results:  You will notice that when you switch buttons, the alert says
"no", but when you rehit the same button, the alert says "yes".

Expected Results:  In NS4, and I think IE, the alert always says "yes".  I don't
know what any standard says, but this has broken existing pages.
I think this worked as I expected in earlier mozilla builds (14? 15?), but I'm
not sure.

*** This bug has been marked as a duplicate of 42972 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Verified dupe.
Status: RESOLVED → VERIFIED
Component: DOM Level 2 → DOM Other
Component: DOM Other → DOM Level 1
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.