Page 1 of 1

Nice popups not advertising

Posted: Tue Jan 25, 2005 12:27 pm
by Chris Corbyn
Hi,

Got a file listing page on my site. Next to each file is a checkbox where the value = name of file.

I want the user to be able to check all the boxes for files he/she wishes to download then click a single button to iniate all downloads.

OK so I know it's not possible... the user will still have to click save file or whatever for each one... that's fine by me.

I was thinking of doing it like this.

User ticks files -> user clicks button -> JavaScript function checks which files are ticked -> JavaScript function opens a new window -> Javascript function changes the location of the window for each file.

It doesn't work. So next I tried opening a new window for each file (so if ten files were chosen ten windows open). It kinda works but it's buggy... locks up a bit. Also I need the window to close agin once the download dialog appears.

Does anyone have any better ideas how to do this?

Cheers :-)

Posted: Tue Jan 25, 2005 12:40 pm
by Chris Corbyn
Hmmm.. bear with me here... think I'm getting there.

Fixed the buggy multiple popups script. Just need a foolproof way to close the window once the download has been started - I'm gonna switch to PHP to force the download and then putting a window.close() right at the end of the script. Should work (I hope). :?

Posted: Tue Jan 25, 2005 12:46 pm
by Chris Corbyn
Damn... what was I thinking? header('location: .....'); redirects the page so the script at the bottom doesn't get read and the window doesn't close... Need to think