js实现对话框与父窗体的传值
2006-07-28 10:50
225 查看
主窗口 main.html
<html>
<head>
<script language="javascript">
function abc()
{
window.showModalDialog("newwindow.html",window,"dialogWidth:500px;dialogHeight:420px;help:0;status:0;resizable:0;scroll:0;center:1;");
}
</script>
</head>
<body>
<img onclick=abc()>
<INPUT type="text" name="me">
</body>
</html>
对话框 newwindow.html
<html>
<head>
<script language="javascript">
var oParent;
function addvalue()
{
oParent = window.dialogArguments;
alert(document.all["a"].value);
oParent.document.all["me"].value=document.all["a"].value;
window.close();
}
</script>
</head>
<body>
<INPUT type="text" name="a" value="hello~">
<INPUT style="WIDTH: 80px" onclick="addvalue();" type="button" value="给父窗体赋值">
</body>
</html>
<html>
<head>
<script language="javascript">
function abc()
{
window.showModalDialog("newwindow.html",window,"dialogWidth:500px;dialogHeight:420px;help:0;status:0;resizable:0;scroll:0;center:1;");
}
</script>
</head>
<body>
<img onclick=abc()>
<INPUT type="text" name="me">
</body>
</html>
对话框 newwindow.html
<html>
<head>
<script language="javascript">
var oParent;
function addvalue()
{
oParent = window.dialogArguments;
alert(document.all["a"].value);
oParent.document.all["me"].value=document.all["a"].value;
window.close();
}
</script>
</head>
<body>
<INPUT type="text" name="a" value="hello~">
<INPUT style="WIDTH: 80px" onclick="addvalue();" type="button" value="给父窗体赋值">
</body>
</html>
相关文章推荐
- js实现跨窗体屏幕锁定并弹出对话框
- 【转】用JS实现弹出模式对话框,实现页面传值
- JS+ACTIVEX实现网页选择本地目录路径对话框
- 文件夹选择对话框 JS实现的两种方案
- ASP.NET窗体对话框的实现
- 前端js实现弹出对话框实现进度条-10
- [Web]如何实现从模式窗体-网页对话框 中获得返回值
- js提示框替代系统alert,自动关闭alert对话框的实现方法
- Android实现一个活动中弹出对话框(如js的alert)
- JS弹出对话框实现方法(三种方式)
- js效果--我的对话框实现
- JS弹出下载对话框以及实现常见文件类型的下载
- JS实现打开文件夹对话框
- js实现每个IP每天只弹出一次广告页,js实现html自动弹出对话框
- 文件夹选择对话框 JS实现的两种方案
- Cocosd2d-js 实现窗体管理器
- 文件夹选择对话框 JS实现(转)
- JS实现广告窗体效果
- VC中实现非标准对话框窗体的实现
- JS实现网页每隔3秒弹出一次对话框的方法