BUG: Onchange Unavailable in VBScript with OptionGroup DTC (193229)



The information in this article applies to:

  • Microsoft Visual InterDev 6.0

This article was previously published under Q193229

SYMPTOMS

When an OptionGroup Design-time control (DTC) is used on an HTML or Active Server Pages (ASP) page, the onchange event associated with the DTC is not available when the Scripting Platform is set to "Client (IE 4.0 DHTML)" and the scripting language is set to VBScript. As a result, any code in the OptionGroup1_onchange() event does not get executed.

RESOLUTION

To work around this problem, use JavaScript instead of VBScript.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open a new Web project in Visual InterDev 6.0, add a new .htm or .asp page, and set the Scripting Platform to the following:

    Client (IE 4.0 DHTML)
    						

  2. Set the client default scripting language to VBScript in the page properties.
  3. Add an OptionGroup DTC to the page and a static list of values.
  4. Add a Textbox DTC below the OptionGroup DTC.
  5. Switch to the Source tab.
  6. Add the following code for the OptionGroup1_onchange event:
          Sub OptionGroup1_onchange
             MsgBox "VBScript"
          End Sub
    					
  7. Save the page, and preview the page in the browser.
  8. Select an option initially and change to a different option in the group.
  9. Set focus to the textbox so that the OptionGroup loses focus.
You will notice that the Message box does not appear, indicating that the OptionGroup1_onchange event never fires.

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