Click to See Complete Forum and Search --> : Can this be done


lmf232s
03-24-2005, 05:10 PM
I have my main page open, on this page there is a button to upload files.
When you click on this button it opens a new window that has the
browse button and allows you to pick your file and upload it.
Once the file uploads, it refreshes the upload window and dispalys
the file you just uploaded and allows you to upload more files if needed.
Now when i am done uploading the files, i click the exit button to close the window.

What i would like to happen is have the list of files i just uploaded
appear on my main page without having to refresh the main page.
(WHY? well the main page is a user screen that has around 20 fields that need to be filled in and then the user submits them to the DB. I dont want to have to call the save function until the are completely done filling out the form due to all the crazy validation that is in place.)

I open to suggestions, i dont have to do it the way i explained.
So any other approachs to this are welcomed.

lmf232s
03-24-2005, 05:23 PM
ok how about something like this. What if were i am going to display the files on the main page, i make it a <div> and i display all the files in the <div>

Now when i have uploaded a file, with javascript is there a way to pass the <Div> the name of the file(a string), so that it will display it?

phpnovice
03-24-2005, 06:29 PM
This is not an ASP question. You asked for a JavaScript solution.

If the popup window was opened with the JavaScript window.open() method then the popup window can pass the name of the selected file back to the main page by executing a JavaScript function in the main page. The following is the JavaScript statement in the popup window to execute a function in the main window:

top.opener.myFunction(arg);

The arg contains the information you wish to pass back to JavaScript in the main page. From there, JavaScript can do with it what you want.