ASP 如何从新窗口中,返回值?内详

来源:百度知道 编辑:UC知道 时间:2024/06/21 08:47:08
我想实现的是,在A页面点击按钮,出来一个新窗口B,在B页面输入我要的值,然后点提交,B页面关闭,把我输入的值,显示在A页面的文本框中,

测试:
新建一个页面,命名为a.asp,代码如下:
<input type="text" name="inputtext" id="inputtext"><input type="button" value="输入" onclick="javascript:window.open('Test.asp','','width=200,height=100')">

新建一个页面,命名为Test.asp,代码如下:
<script>
function setValue(getValue){
opener.document.getElementById("inputtext").value=getValue;
}
</script>
<input name="int" type="text" /><input type="button" onClick="setValue(int.value)" value="确定">

运行a.asp