Article ID: 192114 - Last Review: May 11, 2006 - Revision: 2.0

FIX: Type Mismatch Error in showModalDialog Parameter

This article was previously published under Q192114

On This Page

Expand all | Collapse all

SYMPTOMS

The showModalDialog() function allows you to pass a value into the dialog window. If the method is called from VBScript and a variable is passed to it, as opposed to a literal value like "hello," accessing the dialogArguments property of the window object from within the HTML page that is displayed with showModalDialog will result in a type mismatch error.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug has been corrected in Internet Explorer 5.0 Developer Preview. For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:
http://msdn.microsoft.com/ie/ (http://msdn.microsoft.com/ie/)

http://support.microsoft.com/iep (http://support.microsoft.com/iep)

MORE INFORMATION

Steps to Reproduce Behavior

The following VBScript code calls showModalDialog to access the modalDlg.htm Web page and passes a string variable as the second parameter. This VBScript subroutine is called in response to a button on the page being clicked.
   <SCRIPT language="VBScript">

      Sub btn_onClick()
         sArguments = "OK"
         showModalDialog("modalDlg.htm", sArguments)
      End sub
   </SCRIPT>
				
When you access the window.dialogArguments window property from within Modaldialog.htm, you receive a type mismatch error. Here is the HTML code for Modaldialog.htm. This HTML creates a button that, when clicked, displays dialogArguments in an alert box.
   <HTML>

      <BODY>
         <BUTTON       onclick="alert(dialogArguments)">dialogArguments</BUTTON>
      </BODY>

   </HTML>
				

REFERENCES

For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:
http://msdn.microsoft.com/ie/ (http://msdn.microsoft.com/ie/)

http://support.microsoft.com/iep (http://support.microsoft.com/iep)

APPLIES TO
  • Microsoft Internet Explorer 4.0 128-Bit Edition
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 4.01 Service Pack 1
Keywords: 
kbbug kbfix KB192114
Retired KB ArticleRetired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
 

Article Translations

 

Related Support Centers