View Full Version : how to pass variable from popup window to its parent window?
SBUH
September 21st, 2003, 09:43 AM
Hello, friends. I am using asp and javascript to make a popup window for uploading image from the user' s local machine to the folder on the server. Now there is no problem to upload the image by using a form page and a action page. But how can I send the name of the image uploaded to the parent window?
Could any one who has experience give some suggestion. Thanks very much in advance!
abzoid
September 21st, 2003, 10:12 AM
Use a session variable. However, that value won't be accessible on the parent page until the user does a refresh.
I'd recommend NOT using popup windows, just redirect back to the proper page after upload.
SBUH
September 21st, 2003, 11:38 AM
hello, thanks for your idea. I have tried the session variable before. But there is problem for that. Say the user upload one image and finish the whole process then come back once again to do it and continue without upload any image, then when he proceed to the following page, he will still see the uploaded image he did last time. That is headache. Have u ever met the same situation before?
So is there some other way to do it? Thanks very much in advance!
abzoid
September 21st, 2003, 11:48 AM
Clear the session variable at the start of the upload process.
SBUH
September 21st, 2003, 12:02 PM
hello, before the user can access these pages, he has to be logged in, then with his username during the whole process. So is it possible to just clear that session variable and leave the session("ID") as it is?
abzoid
September 21st, 2003, 12:11 PM
Session("upload") = ""
SBUH
September 22nd, 2003, 02:33 AM
I put it just after the using of session, and It did not work.
the session value is still there! Do you have other way to only abandon only this session value?
abzoid
September 22nd, 2003, 07:46 AM
Did you replace "upload" with the name you are using for that Session variable?
SBUH
September 24th, 2003, 10:23 AM
hello, thanks for your idea. And it works now ! Cheers!
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.