如何从另一个页面获取值到当前页面 [英] how to get a value from another page to current page

查看:126
本文介绍了如何从另一个页面获取值到当前页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在做一个项目。在那个,如果我点击current.html页面中的文本框,那么newpage.html页面将在新窗口中打开。在那个新窗口(newpage.html)上有一个文本框和按钮。如果单击确定按钮,在文本框中输入文本后,新窗口(newpage.html)的文本框值应返回到current.html页面。该怎么做?..任何人都可以帮助我..



提前感谢

Hi,
i am doing one project. on that,if i click a textbox in current.html page then newpage.html page will open in new window.on that new window(newpage.html) one text box and button is there. after entering the text in the textbox if i click the ok button, the textbox value of the new window(newpage.html) should get back to the current.html page. how to do this?..can anyone plz help me..

thanks in advance

推荐答案

调用此函数单击确定按钮



函数OkClick(){

var childtxt = document.getElementById(ctxt)。value ; //子窗口控件

window.opener.document.getElementById(ptxt)。value = childtxt; //父窗口控件

window.close();

}
Call This function On click of OK button

function OkClick(){
var childtxt=document.getElementById("ctxt").value; //Child Window Control
window.opener.document.getElementById("ptxt").value=childtxt; //Parent Window Control
window.close();
}


嗨朋友们,

i创建了一个会话对象来将结果存储在新的html页面中。然后我在当前的html页面中获取对象。它正在工作!!



谢谢
Hi friends,
i have created one session object to store the result in new html page. then i get the object in current html page.It is working !!

Thanks


这篇关于如何从另一个页面获取值到当前页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆