houssam_ballout Posted July 12, 2007 Share Posted July 12, 2007 hello all,I'd a form with a text box, on the same page, I'd an image in which, if I click on it , it will open a new window, From that new window I want to access that form, how can I use?Thanks in advance Link to comment Share on other sites More sharing options...
jesh Posted July 12, 2007 Share Posted July 12, 2007 If one page opens a new window, that new window has a reference of the original window stored in the DOM. You can use this reference to get at the values that are stored in the form:Original Window: <form><input type="text" id="myTextBox" value="SomeValue" /></form> Child Window: <script type="text/javascript">var wnd = window.opener;if(wnd){ var input = wnd.document.getElementById("myTextBox"); if(input) { alert(input.value); }}</script> Check out the section of the HTML DOM tutorial that deals with the window object:http://www.w3schools.com/htmldom/dom_obj_window.asp Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.