Click to See Complete Forum and Search --> : Checkbox code for downloading files


Mervat
11-17-2003, 01:28 PM
Well, how can I create check boxes (each one represent document) after the user check which files to download they just hit one button to download those files. I hope I am not asking for a complicated code.

zachzach
12-30-2003, 01:44 PM
ok here we go
the first page(doesn't matter what its named) should have this code in it:

<form action="GET" action="download.htm"
Download nameofdoc.extension?
<br>
<input type="checkbox" name="nameofdoc.extension">
<br>
<hr>
Download nameofdoc.extension?
<br>
<input type="checkbox" name="1">
<br>
<hr>
Download nameofdoc.extension?
<br>
<input type="checkbox" name="2">
<br>
<hr>
Download nameofdoc.extension?
<br>
<input type="checkbox" name="3">
<br>
<hr>
<input type="submit">
</form>

the next page, called download.htm, should have this code in it:

<script>
1var="http://www.domain.com/path/doc.extension"//if they check the first box, they should download this file.specify the entire url of it(example: http://www.domain.com/path/doc.extension)
2var="http://www.domain.com/path/doc.extension"//you should know what 2 put here
3var="http://www.domain.com/path/doc.extension"//you should know what 2 put here
Querystring1 = location.search.substring(1,255)
QS1=Querystring1.split('&')
for(i=0;i<QS1.length;i++)
{
("QS2" + i) = QS1[i].split('=')
}
for(i=0;i<QS1.length;i++)
{
if(("QS2"+i)[1]="true")
{
window.open(((i+1)+"var"))
}
}
</script>

that should work
hope that helps!