M.O.S. Studios Posted January 14, 2009 Share Posted January 14, 2009 Hey guys, Im working on a page and i need to transfer the info from a form that a user selects to another from that is already open, here is the workflow 1.user fills out form1, 2.selets button "browse" that opens a new window with form2 3.form 2 shows a list of files in a fixed directory(s) 4.user selects desiered file, 5.window closes and places slected info into a readonly textbox i dont expect to anyone to program it for me, i've programed most of it already using php and some copied javascript what i need some one to show me what i have to lookup to find out how to transfer the info from window2 into window1 and how to close the window2. thanks in advance Quote Link to comment Share on other sites More sharing options...
Psycho Posted January 14, 2009 Share Posted January 14, 2009 Use "window.opener". Here's a quick example: page1.htm <html> <body> <a href="test2.htm" target="page2">Open page 2</a> <form name="form1"> Value from page 2: <input type="text" name="page2value"> </form> </body> </html> page2.htm <html> <head> <script type="text/javascript"> function sendToPageOne() { var thisValue = document.getElementById('page2Value').value; window.opener.form1.page2value.value = thisValue; } </script> </head> <body> <form name="form2"> <select name="page2Value" id="page2Value"> <option value="one">One</option> <option value="Two">Two</option> <option value="Three">Three</option> </select> </form> <button onclick="sendToPageOne();">Send to page 1</button> </body> </html> Quote Link to comment Share on other sites More sharing options...
M.O.S. Studios Posted January 14, 2009 Author Share Posted January 14, 2009 THANKS SOO MUCH!!! works like a charm,,, except i never had a working charm before... so lets say it works like a paperweight Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.