Passing data from child window to parent window
-
Hi all, Let me first tell u wat I am trying to do.I have created a webpage with a button.On the click of that button(html control)I am opening a new window (as a popup).Now in this new child window I have some text boxes.I enter data in those textboxes and when I click a button,I want them to be sent to the parent window without the initial content of the parent window getting lost.Please suggest me a way to do so.I have been trying javascript but to no avail.Please help me out.:confused:
-
Hi all, Let me first tell u wat I am trying to do.I have created a webpage with a button.On the click of that button(html control)I am opening a new window (as a popup).Now in this new child window I have some text boxes.I enter data in those textboxes and when I click a button,I want them to be sent to the parent window without the initial content of the parent window getting lost.Please suggest me a way to do so.I have been trying javascript but to no avail.Please help me out.:confused:
in your popup window:
function OnSomethingClick()
{
var el = window.opener.document.getElementById('SomeLabelOrOther');
el.innerText = "Something else"; //obviously, you might want to change a different propertywindow.close();// dont have to do that if you dont want to }
This works for IE... havent tested with FF yet. Will do in a minute. Just did. Doesn't work in FF.
var question = (_2b || !(_2b));
-
in your popup window:
function OnSomethingClick()
{
var el = window.opener.document.getElementById('SomeLabelOrOther');
el.innerText = "Something else"; //obviously, you might want to change a different propertywindow.close();// dont have to do that if you dont want to }
This works for IE... havent tested with FF yet. Will do in a minute. Just did. Doesn't work in FF.
var question = (_2b || !(_2b));
Well thanx for helping me out.I m just gonna try this code.Anyways,can I try something like this?: el.innerText=document.getElementById('Something').value; It is because I need to pass a textbox value from child to parent.
-
in your popup window:
function OnSomethingClick()
{
var el = window.opener.document.getElementById('SomeLabelOrOther');
el.innerText = "Something else"; //obviously, you might want to change a different propertywindow.close();// dont have to do that if you dont want to }
This works for IE... havent tested with FF yet. Will do in a minute. Just did. Doesn't work in FF.
var question = (_2b || !(_2b));
Thanx for ur help...It works !!!
-
Thanx for ur help...It works !!!
Hi again, It is working on simple pages but it is not working when I use master pages.Seems to be a problem.Please help me out. I tried it without master pages and it was working fine,but when I am implementing it using master pages,it isnt working.