模式窗体给父窗体传值
父窗体代码:
<script type="text/javascript">
function show(){
window.showModalDialog("b.jsp",window,"dialogWidth:800px;dialogHeight:400px;");
}
</script>
</head>
<body>
<form action="">
<input type="text" name="yang" id="yang"/>
<input type="button" onclick="show()" value="测试"/>
</form>
</body>
模式窗体:
b.jsp代码:
<script type="text/javascript">
function t(){
var obj=window.dialogArguments;
obj.document.getElementById("yang").value=document.all.niu.value;
window.close();
}
</script>
</head>
<body>
<input type="text" name="niu" id="niu"/>
<input type="button" value="c" onclick="t()"/>
</body>