Closed
Bug 121202
Opened 24 years ago
Closed 24 years ago
Can't set 'checked' property of <Input type=checkbox > while loading a page
Categories
(Core :: Layout: Form Controls, defect)
Core
Layout: Form Controls
Tracking
()
RESOLVED
FIXED
People
(Reporter: Maniac, Assigned: john)
References
()
Details
First look into the source of the URL - it's self-explanatory.
Here goes a description:
The page creates a form with 3 checkboxes. Then inline JavaScript tries to set
each checkbox' 'checked' to 'true' and fails.
After 3 seconds the same JavaScript code is called again (through setTimeout)
and works good.
P.S. When I insert, say, window.alert(elements[i]) before setting 'checked' the
code works good for the first time too.
Reporter | ||
Updated•24 years ago
|
Component: Form Manager → HTML Form Controls
![]() |
||
Comment 2•24 years ago
|
||
confirming on linux 2002-01-19-21. jkeiser?
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 2000 → All
Hardware: PC → All
Assignee | ||
Comment 3•24 years ago
|
||
The problem is probably that the frame doesn't exist yet. Pretty sure this will
go away with bug 108308.
Depends on: 108308
Reporter | ||
Comment 5•24 years ago
|
||
Interesting note: if I use elements[i].setAttribute('checked') instead of
setting directly elements[i].checked=true everything works.
Does Mozilla use different APIs for accessing a property directly or through a
DOM method?
![]() |
||
Comment 6•24 years ago
|
||
.checked and setAttribute("checked") do entirely different things. One sets an
attribute on a node (equivalent to actually editing the HTML). The other
changes the value of a DOM property. The fact that the initial value of the DOM
property is decided based on the value of the attribute is the only thing that
ties the two together.
Reporter | ||
Comment 7•24 years ago
|
||
Thanks for explanation.
My misunderstanding was because I've seen the .checked property on a W3C in the
DOM1 spec. I did think that setting properties through setAttribute or
propertie's corresponding interface should differ just in syntax... Now I see
the true difference :-)
Assignee | ||
Comment 8•24 years ago
|
||
Oops, I set the dependency wrong before, it was bug 108307, which has landed,
and fixed this bug with it.
Updated•23 years ago
|
QA Contact: madhur → tpreston
You need to log in
before you can comment on or make changes to this bug.
Description
•