当前位置:我的异常网» ASP.NET » 怎么获取window.open中的值
怎么获取window.open中的值
www.myexceptions.net 网友分享于:2013-03-03 浏览:49次
如何获取window.open中的值
点击A页面中的某个按钮,弹出B页面(.htm),B页面中有文本框可以输入数据,我想在点击B页面中的提交按钮时,关闭B页面,同时在A页面中获取文本框中输入的数据。请问如何实现?
------解决方案--------------------
A页面:
Afunction opennew()
{
var returnstr=window.showModalDialog( "B.aspx ");
var a=document.getElementById( "TextBox1 ");
a.value=returnstr;
}
Text= "Button " >
runat= "server ">
B:页面
Bfunction closeit()
{
var a=document.getElementById( "TextBox1 ");
parent.returnValue=a.value;
//event.srcElement.value=a.value;
//var b=parent.parent.getElementById( "TextBox1 ");
// alert(b);
//b.value=a.value;
parent.close();
}
runat= "server ">
Text= "Button ">
分别把javascript函数写进button 的onclick
文章评论