entered value from child window to parent window
From a child window or a small window once opened, we can transfer any user entered value to main or parent window by using JavaScript. You can see the demo of this here. Here the parent window is known as opener. So the value we enter in a child window we can pass to main by using opener.document object model. So if the name of the form in parent window is f1 and the text box where we want the value to be passed is p_name ( in parent window ) then from the child window we can access them by using the object.opener.document.f1.p_name
The value for this object can be assigned like thisopener.document.f1.p_name.value="Any value";
We will try to make it interactive so we will assign this to a value entered by the user. Then we will use one input box in child window and name it as c_name. So we can pass the value of the input box of child window to the parent window input box by this line.opener.document.f1.p_name.value = document.frm.c_name.value;
Related Tutorial |
---|
• Refreshing the parent window • Opening Window |
No comments:
Post a Comment