也就是想用showModalDialog打开一个页面,在该窗体上操作要把值更新到父窗体,但showDialogModal窗体不关闭
也就是想用showModalDialog打开一个页面,在该窗体上操作要把值更新到父窗体,但showDialogModal窗体不关闭,因为好象做不到,我用window.open是可以达到功能,但能切换到其窗体.
[解决办法]
调用window.close()就可以关闭
[解决办法]
第一个html
<HTML>
<HEAD>
<TITLE> showModelessDialogEX.htm </TITLE>
<SCRIPT>
var sUserName= " ";
function fnCallDialog(){
showModelessDialog( "myDialog.htm ",window, "status:false;dialogWidth:300px;dialogHeight:300px ");
}
function fnUpdate(){
oName.innerText = sUserName;
}
</SCRIPT>
</HEAD> <BODY>
<P> Enter your first name:
<SPAN STYLE= "color:red;font-size:24 "> Joan </SPAN> </P>
<INPUT TYPE= "button "
VALUE= "Display Modeless Dialog " >
</BODY>
</HTML>
第二个html
<HTML>
<HEAD>
<TITLE> myDialog.htm </TITLE>
<SCRIPT>
function fnGetInfo() {
var sData = dialogArguments;
sData.sUserName = oEnterName.value;
sData.fnUpdate();
}
function fnCancel() {
var sData = dialogArguments;
sData.sUserName = "Joan ";
sData.fnUpdate();
}
</SCRIPT>
</HEAD>
<BODY>
<LABEL FOR= "oEnterName " ACCESSKEY= "f ">
Enter your <SPAN STYLE= "text-decoration:underline "> F </SPAN> irst Name </LABEL>
<INPUT > <INPUT VALUE= "Apply " TYPE=button >
<INPUT VALUE= "Ok " TYPE=button >
<INPUT VALUE= "Cancel " TYPE=button >
</BODY>
</HTML>
运行一下,自己理解!