Microsoft KB Archive/195183

= BUG: Checkbox DTC Clears When Enabled =

Article ID: 195183

Article Last Modified on 3/16/2005

-

APPLIES TO


 * Microsoft Visual InterDev 6.0 Standard Edition

-



This article was previously published under Q195183



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.



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); </li> Save the page and view it in the browser.</li> Click Checkbox1.</li> Click Button1.</li></ol>

Checkbox1 is disabled and selected after step 7, clicking on Button1 enables it and clears the Checkbox.

Steps to Work Around Behavior

 * 1) Right-click the Checkbox DTC and go to Properties.
 * 2) 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).
 * 3) Change the Checkbox1_onclick event handler to be executed on the client.
 * 4) Right-click the Button DTC and go to Properties.
 * 5) Change the Scripting Platform to Client(IE 4.0 DHTML).
 * 6) Change the Button1_onclick event handler to be executed on the client.

Additional query words: check uncheck unchecked checked

Keywords: kbbug kbctrl KB195183

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.