Closed Bug 173270 Opened 23 years ago Closed 23 years ago

null always returned by getAttribute("checked") on <INPUT> button or checkbox

Categories

(Core :: DOM: Events, defect)

x86
Windows ME
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 108480

People

(Reporter: Leland.M.George, Assigned: joki)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2b) Gecko/20021007 Build Identifier: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.2b) Gecko/20021007 controlName.checked returns correct true/false value, while controlName.getAttribute("checked") always returns null. Reproducible: Always Steps to Reproduce: 1. Open attachment 2 [review]. Operate checkbox/radio button controls 3. Observe values in alert box Actual Results: As described at top. Expected Results: According to the Dom 2 specification, the "Return Value [of getAttribute must be the] Attr value as a string, or the empty string if that attribute does not have a specified or default value." (See http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-745549614.) Therefore, if the control is checked (controlName.checked reports true), controlName.getAttribute("checked") must return the string "checked"; otherwise, it must return the empty string "". This may belong under the Dom Core or HTML Form Control component. However, since it appears to relate to bug 173244 and bug 173255, and the same attachment reveals all three, I submit it here under DOM Events. Search for duplicates: Failed using string "input event" (criterion: "contains all words..."), turning up related but distinct bug 97058 and bug 111992. See my remarks on bug 173244 and bug 173255. Search also failed using "radio checked" and "checkbox checked" (same criterion), turning up two others that might be related, though neither of these seems very likely to be. Of the two, bug 159617 seems more likely to relate than 150936, which according to John Keiser's comment #4 (http://bugzilla.mozilla.org/show_bug.cgi?id=150936#c4) may dup bug 14445, already resolved.
setting the presentation value of a form control does not change the source of the element. This means that if the checked attribute is not set on the control it will not be returned by getAttribute. The return value of null instead of '' is a dupe of bug 108480 *** This bug has been marked as a duplicate of 108480 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Comment on attachment 102166 [details] Alert box shows incorrect value returned as described. See bug 173244 and bug 173255.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: