DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   ASP (http://www.daniweb.com/forums/forum62.html)
-   -   Transfer Data From Pop Up To Main Page (http://www.daniweb.com/forums/thread76701.html)

aparnesh Apr 27th, 2007 3:21 pm
Transfer Data From Pop Up To Main Page
 
Can I transfer some data, which the user enters into a pop up window, to the page which called the pop-up window ? The Main page is in a frame. When the user clicks a button on the main page, a pop-up opens showing some choices. After the user selects the choice from the pop-up, the pop up is closed automatically and the main page shows the user's choice.

Can this be done using ASP/Javascript ?

hollystyles Apr 27th, 2007 7:06 pm
Re: Transfer Data From Pop Up To Main Page
 
Yes, say you had a drop down list in the pop up window and a text box in the main page (that's in a frame but it works for me) using this javascript

window.opener.document.getElementById("myInputText").value = document.getElementById("mySelectElement").value;

aparnesh Apr 28th, 2007 3:06 pm
Re: Transfer Data From Pop Up To Main Page
 
Thank You very much, hollystyles !! Is there a way I can tranfer a collection of data, say all selected values from a multi select ?

regards

hollystyles May 1st, 2007 5:26 pm
Re: Transfer Data From Pop Up To Main Page
 
Yes using the same technique. But I can't give code because it depends how you are generating the checkboxes. You will need to post your code for me to see first.

aparnesh May 3rd, 2007 2:54 pm
Re: Transfer Data From Pop Up To Main Page
 
Thanks hollystyles, I managed to solve it. I wrote a small function in the main page, which accepted a data and added it to a select in the main page. I called this function from a loop from the pop-up window. It works fine for my purpose.


All times are GMT -4. The time now is 10:05 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC