Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Pull-down box for files?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I'm trying to use a pull-down box for links to files...any help on this? I find plenty of scripts for links to pages, but not files. Can this be done? It would need to work in IE5.

thanks!
 
I don't think this is possible since you can only get access to the files thru the file attach button.

;-)
 
As long as the file types that you are sending are not viewable by the browser (jpg, gif, html, txt, etc), this should trigger a download.

<form name=&quot;my_form&quot;>
<select name=&quot;file_list&quot;>
<option>document1.xyz</option>
<option>document2.xyz</option>
</select>
<input type=&quot;button&quot; onclick=&quot;window.location=document.my_form.file_list.options[selectedIndex].text;&quot;>
</form>

If the files are not in the same directory as the HTML page, then you can specify the full path to the file like this:

<option value=&quot;
And change the button code to:

<input type=&quot;button&quot; onclick=&quot;window.location=document.my_form.file_list.options[selectedIndex].value;&quot;>

Hope this helps
/johnny
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top