BUG: Checkbox DTC Clears When Enabled (195183)



The information in this article applies to:

  • Microsoft Visual InterDev 6.0

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create an ASP page.
  2. Set Default Scripting Language to Javascript for the page.
  3. Drag and drop a Checkbox DTC and a Button DTC to the page.
  4. In the Checkbox1_onclick() event handler, add the following code:
          Checkbox1.setChecked=(1);
          Checkbox1.disabled=(1);
    						
  5. In the Button1_onclick() event handler, add the following code:
          Checkbox1.disabled=(0);
    						
  6. Save the page and view it in the browser.
  7. Click Checkbox1.
  8. Click Button1.
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.

Modification Type:MinorLast Reviewed:3/16/2005
Keywords:kbBug kbCtrl kbDSupport KB195183