一个showmodaldialog ()返回值的问题?

zhaozipeng 2004-06-14 11:34:38
请问如何得到showmodaldialog 的返回值啊在父窗口里啊。
...全文
104 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
楼上已经给出很详细的例子了~~~
TSD 2004-06-14
  • 打赏
  • 举报
回复
对上面做些更正,第二个文件名应是eg.htm才对!!!!抱歉:)
TSD 2004-06-14
  • 打赏
  • 举报
回复
返回值是可以有多个的,但需要自已处理
TSD 2004-06-14
  • 打赏
  • 举报
回复
以下是我写的一个示例文件,希望对你有所帮助。

有问题再发消息给我!!

sd.htm

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>TSD</title>
<SCRIPT language="javascript">
<!--
function OpenWin()
{
var getv = showModalDialog("eg.htm", "egwin", "dialogWidth:420px; dialogHeight:220px;status:no;help:yes");
if (getv != null){
TextInfo.value=getv;
}
}

//-->
</SCRIPT>
</head>

<body>
<div align="center">
<p>  </p>
<p> </p>
<p> </p>
<p>
<input type="button" name="Submit" value="打开" onClick="OpenWin()">
<input name="TextInfo" type="text" id="TextInfo">
</p>
</div>
</body>
</html>

-----------------------------------
sd.htm

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>TSD</title>
<SCRIPT language="javascript">
<!--
function GetValue()
{
window.returnValue=TextName.value
window.close();
}

//-->
</SCRIPT>

</head>

<body>
<p> </p>
<p> </p>
<p align="center"> </p>
<p align="center">
<input name="TextName" type="text" id="TextName" value="因为有你而精彩">
<input type="button" name="Submit" value="关闭" onClick="GetValue()">
</p>
</body>
</html>
wesheng 2004-06-14
  • 打赏
  • 举报
回复
不过好像不能反回多个值啊。
GageCSDN 2004-06-14
  • 打赏
  • 举报
回复
var reVal = window.showmodaldialog('...','....','....');

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧