BUG: Checkbox DTC Clears when Enabled
ID: Q195183
|
The information in this article applies to:
-
Microsoft Visual InterDev, version 6.0
SYMPTOMS
When a Checkbox Design-Time Control (DTC) is selected and disabled,
enabling the check box will automatically clear the check box. This occurs
when the scripting platform is Server (Active Server Pages [ASP]) for the
Checkbox DTC.
CAUSE
This is a bug.
RESOLUTION
You can programmatically work around this behavior by adding the following
code when enabling the check box:
Checkbox1.setChecked((Request.Form('_Checkbox1_state').item.search
(/_checked=true/)+1)!=0);
In the sample given below, make the following modification to the
Button1_onclick() function:
function Button1_onclick() {
Checkbox1.disabled=0;
Checkbox1.setChecked((Request.Form('_Checkbox1_state').item.search
(/_checked=true/)+1)!=0); //add this line
}
You can also work around this behavior by setting the scripting platform to
Client(IE 4.0 DHTML) for the Checkbox DTC.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
MORE INFORMATION
Steps to Reproduce Behavior
- Create an ASP page.
- Set Default Scripting Language to Javascript for the page.
- Drag and drop a Checkbox DTC and a Button DTC to the page.
- In the Checkbox1_onclick() event handler, add the following code:
Checkbox1.setChecked=(1);
Checkbox1.disabled=(1);
- In the Button1_onclick() event handler, add the following code:
Checkbox1.disabled=(0);
- Save the page and view it in the browser.
- Click Checkbox1.
- Click Button1.
Checkbox1 is disabled and selected after step 7, clicking on Button1
enables it and clears the Checkbox.
Steps to Work Around Behavior
- Right-click the Checkbox DTC and go to Properties.
- Change the Scripting Platform to Client(IE 4.0 DHTML). You will notice
in the Script outline that the checkbox has been moved into the "Client
Objects and Events" area).
- Change the Checkbox1_onclick event handler to be executed on the client.
- Right-click the Button DTC and go to Properties.
- Change the Scripting Platform to Client(IE 4.0 DHTML).
- Change the Button1_onclick event handler to be executed on the client.
Additional query words:
check uncheck unchecked checked
Keywords : kbCtrl kbVisID600bug kbGrpASP
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug