Closed Bug 7127 Opened 25 years ago Closed 24 years ago

clicking label of checkbox does check though checkbox disabled

Categories

(Core :: Layout: Form Controls, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: Brade, Assigned: pollmann)

Details

(Keywords: testcase, Whiteboard: [TESTCASE])

Attachments

(1 file)

Below is the source for "text.xul" which exhibits this bug. The bug is that a label for a checkbox allows the user to set or remove the check even though the checkbox itself has been disabled. To exercise the bug simply click the radio button to "disable elements" and then click the label for the checkbox. <?xml version="1.0"?> <?xml-stylesheet href="resource:/res/samples/xul.css" type="text/css"?> <window xmlns:html="http://www.w3.org/TR/REC-html40" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="300" height="300" onload="onLoad()"> <html:script> function disablingOfElements() { // disable checkbox var constrainCheckbox = document.getElementById("dimConstrain.checkbox"); if ( constrainCheckbox ) { constrainCheckbox.setAttribute( "disabled", "true" ); } } function enablingOfElements() { // enable checkbox var constrainCheckbox = document.getElementById("dimConstrain.checkbox"); if ( constrainCheckbox ) { constrainCheckbox.removeAttribute( "disabled" ); } } function onLoad() { disablingOfElements(); } function dimConstrainClick() { } </html:script> <html:p> Click on the text "BUG" below </html:p> <html:br/> <box align="vertical"> <html:input type="radio" id="disabling.radio" value="1" onclick= "disablingOfElements()" /> <html:label for="disabling.radio"> Disabled elements</html:label> <html:br/> <html:input type="radio" id="enabling.radio" onclick="enablingOfElements()" / > <html:label for="enabling.radio"> Enabled elements</html:label> </box> <html:br/> <html:input type="checkbox" id="dimConstrain.checkbox" onclick= "dimConstrainClick()" /> <html:label for="dimConstrain.checkbox">BUG</html:label> </window>
The same problem can be created by clicking on a label for input type="text" that has been disabled. Do you want that written up as a separate bug?
Assignee: karnaze → pollmann
Reassigning to Eric.
Kathy, one bug is sufficient.
Possibly these should be in another bug (let me know if you want me to create it). Clicking in the label for the following items activates its corresponding controls even they the controls are disabled: html:input type="text" html:input type="password" html:input type="file" note: unlike the initial report of checkboxes and radio buttons, with the above input types, the controls themselves can be clicked in to activate them (even though they've been set to disabled).
Windows also has this bug; resetting platform/os to ALL since it may very well be an XP bug.
OS: Mac System 8.5 → All
Hardware: Macintosh → All
Moving all Widget Set bugs, past and present, to new HTML Form Controls component per request from karnaze. Widget Set component will be retired shortly.
Assignee: ckritzer → pollmann
QA Contact: phillip → ckritzer
Whiteboard: [TESTCASE]
Target Milestone: M13 → M15
Attaching the [TESTCASE] and setting to M15.
Attached file test.xul test case (deleted) —
Bulk moving [testcase] code to new testcase keyword. Sorry for the spam!
Keywords: testcase
Kathy, if I understand the behaviour, the original bug states that the checkbox was still active (able to check and uncheck it) even tho' the radio button told the checkbox it was disabled...is that correct? The testcase is disabling the checkbox when you select the 'Disable Elements' radiobutton, and if this is correct and expected behaviour, I can close this bug out...
Moving out to M17.
Target Milestone: M15 → M17
Rescheduling
Status: NEW → ASSIGNED
Target Milestone: M17 → M18
Is the net customer impact here that we are unable to disable form controls from JavaScript? How widely is this functionality used on the Web?
That is pretty much the net effect. The checkbox will look disabled, but you can still check it. I haven't tested this with recent builds - may have been fixed.
I'm testing this on 2000051720 Win2K, and it looks OK... The disabled checkbox doesn't select if I click the label.
Marking FIXED per those comments. QA please verify.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Updating QA contact.
QA Contact: ckritzer → bsharma
Verified Build 2001071508 os:win95/win98
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: