Microsoft KB Archive/190051

= FIX: HTML Dialog Ignores Size Parameters Without SCRIPT Block =

Article ID: 190051

Article Last Modified on 5/11/2006

-

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

-



This article was previously published under Q190051



SYMPTOMS
The Dynamic HTML (DHTML) window object provides a showModalDialog method, which creates a dialog box to display an HTML document. The "features" parameter of this method describes how the dialog box is to look and includes dialogHeight and dialogWidth values to indicate the size of the dialog box.

When showModalDialog is called from within DHTML script, the dialog box fails to resize according to the dialogHeight and dialogWidth features parameters.



CAUSE
HTML dialog boxes created by showModalDialog ignore changes to dialogHeight and dialogWidth unless the dialog HTML page contains at least one  block.



Solution 1
Add at least one  block to the dialog HTML page. This  block can be empty:  

Solution 2
Provide a style for the HTML tag in the HEAD element of the dialog HTML document that specifies the width and height attributes. The following HTML demonstrates this: 

 HTML {width:400px; height:200px; top-margin:0; bottom-margin:0; left-margin:0; right-margin:0} 





STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in Microsoft Internet Explorer 5.



MORE INFORMATION
The following SCRIPT code reproduces this symptom if Dlg.htm is an HTML file with no  blocks: <SCRIPT LANGUAGE="JavaScript">

showModalDialog("dlg.htm","","dialogHeight:50px;dialogWidth:50px");

</SCRIPT>

<div class="references_section">