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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list menu and zip files

Status
Not open for further replies.

idaryl

Technical User
Nov 10, 2001
156
US
Hello all,

my client has about 25 zipped pdf files that are date ordered and they want the user to select from the drop down list a date, (I've only shown three) then the appropriate file will be opened or downloaded.. shown is what I have so far - however I'm sure there is something I've left out - [naturally] - I'm no java guy by any means ;-(

So, any help would be appreciated

Code:
<form name="pdfs" method="post" action="">
<select name="select" class="BodyText">
<option value="../pdfs/001.zip">Fall/Winter 2003</option>
<option value="../pdfs/002.zip">February 2003</option>
<option value="../pdfs/003.zip">September 2003</option>
</select>
</form>

idaryl
idface.gif
 
Instaed of a normal forms dropdown, create a jump menu that links to the zip files. DW will then generate the correct code.

Cheech

[Peace][Pipe]
 
Cheech's advice didn't work?
create = insert

what is the problem....ok ok Cheech is from GB ...that might be it!LOL

Insert--->Form Objects--->Jump Menu

it is that easy!
here is the code it spits out:
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenuGo(selName,targ,restore){ //v3.0
  var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
}
//-->
</script>
</head>

<body>
<form name="form1">
  <select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
    <option value="file1.zip" selected>file 1</option>
    <option value="file2.zip">file 2</option>
  </select>
  <input name="DL_button" type="button" id="DL_button" onClick="MM_jumpMenuGo('menu1','parent',0)" value="Download &gt;">
</form>
<p>&nbsp;</p></body>
</html>

of course u can choose NOT to have the "download" button but rather direct/onChange of list download....
All the best!

:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top