Closed Bug 68139 Opened 25 years ago Closed 25 years ago

Radio-button values not available through JavaScript

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla0.9

People

(Reporter: dwallace, Assigned: jst)

References

Details

(Keywords: regression, Whiteboard: [HAVE FIX])

Attachments

(3 files)

I will try to attach my testcase after this. I am using the onClick attribute of an anchor tag to call a JavaScript function that reads the value of a set of checkboxes to build a URL. Apparently, "document.forms[0].radioid[i].value" returns the value "on" for a checked checkbox. Netscape and IE return the value attribute of that checkbox. This may be related to http://bugzilla.mozilla.org/show_bug.cgi?id=65168 but seems different enough that I am submitted a separate report. Using Mozilla/5.0 (X11; U; Linux 2.2.18 i686; en-US; m18) Gecko/20010207 but I have been noticing the problem in nightlies for about a week now.
confirming, seeing on 2001020804 win98 ->dom0 i believe
Assignee: rods → jst
Status: UNCONFIRMED → NEW
Component: Form Submission → DOM Level 0
Ever confirmed: true
Keywords: regression
OS: Linux → All
QA Contact: vladimire → desale
Confirming. On 2001020721 linux. Simple call to document.FormName.RadioName[i].value returns "on" instead of value. In talking with a few people on #mozilla it looks like getAttribute('value') works.
getAttribute('value') and .value do totally different things. getAttribute('value') does the same thing as .defaultValue
johnny, might this be due to your checkin that returns "on" for .checked?
Attached patch Proposed fixSplinter Review
This is a regression I caused when fixing bug 44615, I thought I had tested the fix in that bug in all cases I could think of but obviously I missed the obvious case, duh! Anyway, the attached patch fixes this problem w/o breaking the testcase in bug 44615.
Status: NEW → ASSIGNED
Priority: -- → P3
Hardware: PC → All
Whiteboard: [HAVE FIX]
Target Milestone: --- → mozilla0.9
i think this should warrant 0.8 checkin, as a lot of sites use this for error checking of forms. nominating for that and cc:'ing asa
Keywords: mozilla0.8
Summary: Checkbox values not available through JavaScript → Radio-button values not available through JavaScript
patch [ id=24785 ] look good. r=harishd
sr=vidur
*** Bug 68268 has been marked as a duplicate of this bug. ***
a=blizzard/asa for checkin to 0.8
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Thanks for the reviews n' approvals, fix checked in.
Keywords: mozilla0.8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: