Closed Bug 122461 Opened 23 years ago Closed 23 years ago

CHECKED attribute in checkbox html does not activate checkboxDOMObj.checked attribute

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: raz, Assigned: jst)

Details

Attachments

(1 file)

if you make a checkbox html tag via <input type=checkbox CHECKED> and then make inline javascript which checks the state of the checked attribute, it will return false... however, an inline setTimeout of the same call a few seconds later will return true. See attached html file which demonstrates issue. I found this out when working on a UI for my company. I did a few inline calls of onClick functions I had made for checkboxes to hide and show the right divs for the ui. I do not have control of the onLoad attribute of the html doc so it is not possible to call the functions from their. My only option is to make script tags and call their 'onClick' functions after the html is written. Perhaps this is an issue with threading? I have never seen this problem before. I am using build 2001122110 for Solaris. Perhaps this is fixed in a more recent build, but this is the most stable build I have found for solaris besides 0.9.6 Wayne
I have worked around this issue via inline calls to checkboxDOMObj.checked = 1. This DOES cause a check of checkboxDOMObj.checked to return true where as just making the CHECKED attribute in the html object does not. I have added these fixes to the perl source of the ui cgi so it will put the CHECKED attribute in the html and set the checked=1 in javascript to the dom object. Wayne
Browser, not engine ---> DOM Level 0 Confirming bug with Mozilla binaries 20020116xx on WinNT, Linux. First alertbox: 'state of checked attribute is false' Second one: 'state of checked attribute is true'
Assignee: rogerl → jst
Status: UNCONFIRMED → NEW
Component: JavaScript Engine → DOM Level 0
Ever confirmed: true
QA Contact: pschwartau → desale
However, resolving as WORKSFORME, since Mozilla binaries from 20020125xx seem not to have the erorr: First alertbox: 'state of checked attribute is true' Second one: 'state of checked attribute is true' Wayne, thank you for this well-written report. Could you try a more recent build and see if the bug has gone away for you, too? If so, you can mark this bug "Verified". If not, you can reopen it; thanks -
Status: NEW → RESOLVED
Closed: 23 years ago
OS: SunOS → All
Hardware: Sun → All
Resolution: --- → WORKSFORME
bug still present on solaris nightly 2002011510 This is the latest nightly on the server from what I can see. The box this is running on is an ultra60 with 2 300mhz cpu's and 512 meg of ram. The browser isn't the fastest thing out there on solaris so I am betting, while usable and not 'really slow', it is still slow enough to make 'timing issues' appear. It almost seems like the dom object isn't finished creating itself when the javascript is ran. I don't know the code base.. but from an oursider who does lots of OO development.. thats the 'feel' I get. Re-opening as it is still present in latest nightly for solaris.
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
it almost appears that the bug is fixed in a later version not yet available outside of source download on solaris. Do you think you could 'refresh' many times to see if the bug does re-appear at random... it may still be in newer builds but just hiding due to code changes which change timing a bit. Once again, hanging onto the unverified not so sure might not be theory that timing is involved. All I can do is wait for newer solaris binaries I guess. Wayne
> bug still present on solaris nightly 2002011510 > it almost appears that the bug is fixed in a later version not yet available outside of source download on solaris. Right on both counts. I'm almost positive that once you're able to get a build from 2002-01-25 or after, this will work for you. Let's hope, anyway!
Despite Phil's comments, a form of this bug still exists in 0.9.8 Trying to change any checkbox in JavaScript while the page is loading has no effect. It does work afterword via JavaScript (i.e. triggered by a user action of some sort). Below is a small page which demonstrates both when checkboxes do work properly, and when they don't: <html> <head> </head> <body> <form name="EditMemberForm" method=get action="http://aragorn/scripts/ghb/MembersDirectory.exe/SubmitMember?"> <h3><input type="checkbox" name="PublishOnlineField">Include me in the Online Directory</h3> <p> <a href="#" onclick="document.EditMemberForm.PublishOnlineField.checked=true; return false;">check</a>&nbsp; <a href="#" onclick="document.EditMemberForm.PublishOnlineField.checked=false; return false;">uncheck</a> </p> <input type="submit" name="UpdateButton" value="Submit Changes"> </form> <script> window.document.EditMemberForm.PublishOnlineField.checked=true; </SCRIPT> </body> </html>
The initial problem in this bug has been fixed (probably by jkeiser's form control work), marking FIXED. If there are remaining issues with checkboxes, please open new bugs on those issues.
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: