IE 非模式对话框返回值的问题
在IE中的主画面想得到对话框中的文本框中的值
值已经取到了,但是主画面接不到,就是说window.returnValue = rtnValue;(rtnValue有值)
接不到
我用的是showModelessDialog,高手们,还有其他的非模式,并且没有最大化,最小化按钮(大小固定)的打开dialog的方法吗?只要能返回值就行啊
[解决办法]
var rtnValueStr = window.showModalDialog(xxxxx);
接不到???
[解决办法]
D~
[解决办法]
<HEAD>
<HTML>
<HEAD>
<TITLE> showModelessDialogEX.htm </TITLE>
<SCRIPT>
var sUserName= " ";
/*------------------------
Supplying the window object as a parameter allows for declaring the global
variable, sUserName, and using it to return information from the modeless
dialog box.
------------------------- */
function fnCallDialog()
{
showModelessDialog( "myDialog.htm ",window, "status:false;dialogWidth:300px;dialogHeight:300px ");
}
/*-------------------------
The fnUpdate function takes the value passed into sUserName in myDialog.htm
to update the span text on this page. This function is called in both
fnGetInfo and fnCancel functions in myDialog.htm.
-------------------------*/
function fnUpdate()
{
oName.innerText = sUserName;
}
</SCRIPT>
</HEAD>
<BODY>
<P> Enter your first name: <SPAN ID= "oName "
STYLE= "color:red;font-size:24 "> Joan </SPAN> </P> <INPUT TYPE= "button "
VALUE= "Display Modeless Dialog " onclick= "fnCallDialog() ">
</BODY>
</HTML>
=============================================================
<HTML>
<HEAD>
<TITLE> myDialog.htm </TITLE>
<SCRIPT>
/* -------------------------
This function makes use of the dialogArguments property of the
window object. dialogArguments allows the global variable sUserName
to feed the value supplied to the input in this dialog box back to
the window that called it.
---------------------------- */
function fnGetInfo()
{
var sData = dialogArguments;
sData.sUserName = oEnterName.value;
sData.fnUpdate();
}
/* -------------------------
This function cleans up in case the user has clicked the
Apply button before canceling.
---------------------------- */
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 ID=oEnterName> <BR> <BR>
<INPUT VALUE= "Apply " TYPE=button onclick= "fnGetInfo(); ">
<INPUT VALUE= "Ok " TYPE=button onclick= "fnGetInfo();window.close(); ">
<INPUT VALUE= "Cancel " TYPE=button onclick= "fnCancel();window.close(); ">
</BODY>
</HTML>
==============================
LZ试一下吧
DHTML里面的例子
------解决方案--------------------
:
vReturnValue = window . showModelessDialog ( sURL , vArguments , sFeatures )
参数:
sURL 必选项。字符串(String)。指定要载入和显示的 URL 。
vArguments 可选项。指定供显示文档时使用的变量。利用这个参数可以传递任何类型的值,包括包含多个值得的数组。对话框可以通过调用程序从 window 对象的 dialogArguments 属性提取这些值。
sFeatures 可选项。字符串(String)。指定对话框的窗口装饰。使用下面的值。多个之间用分号隔开。 dialogHeight : sHeight 设置对话框的高度。
dialogLeft : sXPos 设置对话框左上角相对于桌面的横坐标。
dialogTop : sYPos 设置对话框左上角相对于桌面的纵坐标。
dialogWidth : sWidth 设置对话框的宽度。
center : yes | no | 1 | 0 | on | off 指定对话框是否显示于桌面正中。默认值为 yes 。
dialogHide : yes | no| 1 | 0 | on | off 指定当打印或打印预览时对话框是否隐藏。仅仅当对话框是由被信任的程式打开的时候此参数才可用。默认值为 no 。
edge : sunken | raised 指定对话框窗口边框样式为凹下还是凸起的。默认值为 raised 。
help : yes | no | 1 | 0 | on | off 指定对话框是否显示上下文相关的帮助图标。默认值为 yes 。
resizable : yes | no | 1 | 0 | on | off 指定对话框是否可以被用户改变尺寸。默认值为 no 。
scroll : yes | no | 1 | 0 | on | off 指定对话框是否显示滚动条。默认值为 yes 。
status : yes | no | 1 | 0 | on | off 指定对话框是否显示状态条。对于不被信任的对话框默认值为 yes 。对于被信任的对话框默认值为 no 。
unadorned : yes | no | 1 | 0 | on | off 指定对话框是否显示 chrome 样式边框。仅仅当对话框是由被信任的程式打开的时候此参数才可用。默认值为 no 。
返回值:
vReturnValue 返回用于脚本方法的对此对话框( window )对象的引用。