Closed
Bug 53860
Opened 24 years ago
Closed 24 years ago
HTML <input type="checkbox"/> has no checked value (also radio)
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla0.8
People
(Reporter: murphy, Assigned: jst)
Details
(Whiteboard: [HAVE FIX])
Attachments
(2 files)
836 bytes,
text/html
|
Details | |
766 bytes,
patch
|
Details | Diff | Splinter Review |
Tested with build 2000091212
As I understand it, if a checkbox (or radio) even has a checked attr node, then
it is in fact checked. Taking that further, if we use XHTML checked="checked"
also means that it is checked.
The problem is that when the checked attr node is created using the DOM, it does
not affect the checkbox. Also, if I try to give the checked node a "checked"
value, it only will return a "" string.
Finally, physically clicking on the checkbox does not affect the DOM either. It
does not even create the attr node. Try commenting out the load() lines to test
that.
IE uses this weird true/false scenario.
Here is the code, and it is also attached:
<html>
<script>
function load()
{
// Should check the box during load
document.getElementById("save").setAttribute("checked","checked");
// Should return "checked"
alert(document.getElementById("save").getAttribute("checked"));
// It will return the attr object however
alert(document.getElementById("save").getAttributeNode("checked"));
}
function unload()
{
// After clicking, should also return "checked"
alert(document.getElementById("save").getAttribute("checked"));
// After clicking, should also return "checked"
alert(document.getElementById("save").getAttributeNode("checked"));
}
</script>
<body onload="load();">
<form>
<input type="checkbox" onclick="unload()" id="save"/>
</form>
</body>
Reporter | ||
Comment 1•24 years ago
|
||
Reporter | ||
Updated•24 years ago
|
Component: DOM Level 2 → DOM Level 1
Comment 2•24 years ago
|
||
When I test on Linux build 20000922, I get a blank alert box getAttribute()
and "[object Attr]" for the getAttributeNode(). So I think I've confirmed
the first part of the bug. I don't know enough about DOM or JavaScript
to confirm the rest of it, but the rest of it might want to be in a different
bug anyways.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee | ||
Comment 3•24 years ago
|
||
Assignee | ||
Comment 4•24 years ago
|
||
The attached patch does fix the problem but the chance of me actually getting
the permission to check this in for Netscape 6.0 is very small so this'll haveto
wait for post release.
Severity: critical → normal
Status: NEW → ASSIGNED
OS: Windows 2000 → All
Hardware: PC → All
Whiteboard: [HAVE FIX]
Target Milestone: --- → Future
Comment 5•24 years ago
|
||
I say, let's get this into the trunk. patch and review keywords.
This should probably be re-patched against the current tree
Comment 7•24 years ago
|
||
And now no action has taken place for 2 weeks now.
Jst: Is all that needs to be done here is recreate a patch file from the trunk
and get r=/sr=?
Assignee | ||
Comment 8•24 years ago
|
||
All that's needed here is r&sr=, the current patch is IMO still clear enough
even if it doesn't apply (I'm not even sure it doesn't)...
Assignee | ||
Comment 9•24 years ago
|
||
Eric Pollmann sez r=pollmann.
Comment 10•24 years ago
|
||
*** Bug 12348 has been marked as a duplicate of this bug. ***
Assignee | ||
Comment 11•24 years ago
|
||
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updated•24 years ago
|
Component: DOM Level 1 → DOM HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•