<script>
function fnRandom(iModifier){
return parseInt(Math.random()*iModifier);
}
function fnSetValues(){
var iHeight=oForm.oHeight.options[
oForm.oHeight.selectedIndex].text;
if(iHeight.indexOf("Random")>-1){
iHeight=fnRandom(document.body.clientHeight);
}
var sFeatures="dialogHeight: " + iHeight + "px;";
return sFeatures;
}
function fnOpen(){
var sFeatures=fnSetValues();
window.showModalDialog("showModalDialog_target.htm", "",
sFeatures)
}
</script>
<form name=oForm>
Dialog Height <select name="oHeight">
<option>-- Random --
<option>150
<option>200
<option>250
<option>300
</select>
Create Modal Dialog Box
<input type="button" value="Push To Create"
onclick="fnOpen()">
</form> http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/showmodaldialog.asp
|