...

View Full Version : Dynamic drop-down - eliminate dupes



anessa05
05-03-2007, 09:02 PM
Hi!
How can I eliminate the drop-down dupes and have the drop-downs default to the top? Here's a link...

http://amsa.army.mil/InjuryReports/Army/F1.htm

There are over 1,000 individual pdfs, separated into subfolders for /location/month_yr/. Each month, hundreds more pdfs are added. I need something that would load and work fast as well as be easy to update each month. Any suggestions on how to improve this would be greatly appreciated.

NOTE: Due to character limits in this forum, I'm forced to post the 'Action' page code in a separate post immediately after this one.


------------------- F1.htm -------------------


<html>

<head>
<title>New Page 1</title>
<base target="main">

</head>

<body background="../../Background_Tiles/Mar10thOffwhiteBkgrndTile.jpg" leftmargin="20">
<center><img border="0" src="../injurybanner.gif" width="471" height="60"></center>

<script language="javascript">
document.write("<FORM METHOD=LINK ACTION=F2.htm>");
document.write("<p align=center><table width=339 align=center><tr><td width=132 align=left>");
document.write("<p align=left>Choose a Location:</p></td><td width=196 align=left>");
document.write("<select name=CAMP onChange =submit() >");
document.write("<option value=army>Army All<option value=aberdeen>Aberdeen Prov. Ground <option value=belvoir>Fort Belvoir <option value=benning>Fort Benning<option value=bliss>Fort Bliss<option value=bragg>Fort Bragg<option value=campbell>Fort Campbell");
document.write("<option value=carson>Fort Carson<option value=drum>Fort Drum<option value=eustis>Fort Eustis<option value=gordon>Fort Gordon<option value=hood>Fort Hood<option value=huachuca>Fort Huachuca<option value=irwin>Fort Irwin");
document.write("<option value=jackson>Fort Jackson<option value=knox>Fort Knox<option value=leavenworth>Fort Leavenworth<option value=lee>Fort Lee<option value=wood>Fort Leonard Wood<option value=lewis>Fort Lewis<option value=meade>Fort Meade");
document.write("<option value=polk>Fort Polk<option value=riley>Fort Riley<option value=rucker>Fort Rucker<option value=samhouston>Fort Sam Houston<option value=sill>Fort Sill<option value=stewart>Fort Stewart<option value=story>Fort Story<option value=wainwright>Fort Wainwright");
document.write("<option value=europe>Europe<option value=hawaii>Hawaii<option value=hunter>Hunter AAF<option value=korea>Korea<option value=westpoint>USMA West Point<option value=washington>Washington DC </select>");

document.write("</td></tr><tr><td width=132 align=left> <p align=left>Choose a Report:&nbsp &nbsp</td><td width=196 align=left>");
document.write("<select name=MONTH onChange=submit()><option value=February07>February 2007<option value=January07>January 2007<option value=December06>December 2006<option value=November06>November 2006<option value=October06>October 2006<option value=September06>September 2006<option value=August06>August 2006<option value=July06>July 2006<option value=June06>June 2006<option value=May06>May 2006<option value=April06>April 2006<option value=March06>March 2006<option value=February06>February 2006<option value=January06>January 2006<option value=December05>December 2005<option value=November05>November 2005<option value=October05>October 2005<option value=September05>September 2005<option value=August05>August 2005<option value=July05>July 2005<option value=June05>June 2005<option value=May05>May 2005<option value=April05>April 2005<option value=March05>March 2005<option value=February05>February 2005<option value=January05>January 2005<option value=December04>December 2004<option value=November04>November 2004<option value=October04>October 2004<option value=September04>September 2004<option value=August04>August 2004<option value=July04>July 2004<option value=June04>June 2004<option value=May04>May 2004<option value=April04>April 2004<option value=March04>March 2004<option value=February04>February 2004<option value=January04>January 2004<option value=December03>December 2003<option value=November03>November 2003<option value=October03>October 2003<option value=September03>September 2003 <option value=August03>August 2003<option value=July03>July 2003<option value=June03>June 2003<option value=May03>May 2003<option value=April03>April 2003<option value=March03>March 2003<option value=February03>February 2003<option value=January03>January 2003<option value=December02>December 2002<option value=November02>November 2002<option value=October02>October 2002<option value=September02>September 2002<option value=August02>August 2002<option value=July02>July 2002<option value=June02>June 2002<option value=May02>May 2002<option value=April02>April 2002<option value=March02>March 2002<option value=February02>February 2002<option value=January02>January 2002 <option value=December01>December 2001<option value=November01>November 2001<option value=October01>October 2001 </select>");


document.write("</td></tr></table>");
document.write("</Form>");

camp = "army";
month = "February07";

document.write("<center><td width=517><table border=0 cellpadding=12><tr>");
document.write(" <td align=center><strong><font size=2>");
document.write(" <a href="+ camp +"/"+ month +"/"+ camp +"1.pdf target=_top>Injury Trends </a></font></strong></td>");
document.write(" <td align=center><strong><font size=2><a href="+ camp +"/"+ month +"/"+ camp +"2.pdf target=_top>Causes of<br>");
document.write(" Serious Injury</a></font></strong></td>");
document.write("<td align=center><strong><font size=2><a href="+ camp +"/"+ month +"/"+ camp +"3.pdf target=_top>Medical<br>");
document.write(" Encounters</a></font></strong></td>");
document.write("<td align=center><strong><font size=2><a href="+ camp +"/"+ month +"/"+ camp +"4.pdf target=_top>Soldier<br>");
document.write(" Duty Status</a></font></strong></td>");
document.write("<td align=center><strong><font size=2><a href="+ camp +"/"+ month +"/"+ camp +".pdf target=_top>View<br>");
document.write("Entire Report</a></font></strong></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +"1.pdf target=_top><img border=0 src=../injurytrends.gif width=77 height=97></a></strong></td>");
document.write("<td align=center>");
document.write(" <p align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +"2.pdf target=_top><img border=0 src=../causes.gif width=74 height=97></a></strong></td>");
document.write("<td align=center>");
document.write(" <p align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +"3.pdf target=_top><img border=0 src=../medical.gif width=73 height=97></a></strong></td>");
document.write(" <td align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +"4.pdf target=_top><img border=0 src=../last.gif width=75 height=97></a></strong></td>");
document.write(" <td align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +".pdf target=_top><img border=0 src=../Front.gif width=74 height=97></a></strong></td>");
document.write("</tr></table><p align=center>&nbsp<p align=center>&nbsp</div></center><p align=center>&nbsp</p>");
document.write("</form>");

</script>

</body>
</html>

anessa05
05-03-2007, 09:03 PM
------------------- F2.htm [ The 'Action' page ]-------------------


<html>

<head>
<title>New Page 1</title>


</head><body background="../../Background_Tiles/Mar10thOffwhiteBkgrndTile.jpg" leftmargin="20">


<FORM NAME="form1">
<INPUT TYPE="hidden" NAME="input1" SIZE="35">
</FORM>


<SCRIPT LANGUAGE="javascript">

var locate = window.location
document.form1.input1.value = locate

var text = document.form1.input1.value

function delineate(str){

theleft = str.indexOf("=") + 1;
theright = str.lastIndexOf("&");
return(str.substring(theleft, theright));
}
</SCRIPT>

<SCRIPT LANGUAGE="javascript">

var locate = window.location
document.form1.input1.value = locate

var text = document.form1.input1.value

function delineate2(str){

point = str.lastIndexOf("=");

return(str.substring(point+1,str.length));
}
</SCRIPT>

<script language="javascript">

camp=delineate(text);

month=delineate2(text);

switch(camp){
case "army":
PROPER1="Army All";
break;
case "aberdeen":
PROPER1="Aberdeen Prov. Ground";
break;
case "belvoir":
PROPER1="Fort Belvoir";
break;
case "benning":
PROPER1="Fort Benning";
break;
case "bliss":
PROPER1="Fort Bliss";
break;
case "bragg":
PROPER1="Fort Bragg";
break;
case "campbell":
PROPER1="Fort Campbell";
break;
case "carson":
PROPER1="Fort Carson";
break;
case "drum":
PROPER1="Fort Drum";
break;
case "eustis":
PROPER1="Fort Eustis";
break;
case "gordon":
PROPER1="Fort Gordon";
break;
case "hood":
PROPER1="Fort Hood";
break;
case "huachuca":
PROPER1="Fort Huachuca";
break;
case "irwin":
PROPER1="Fort Irwin";
break;
case "jackson":
PROPER1="Fort Jackson";
break;
case "knox":
PROPER1="Fort Knox";
break;
case "leavenworth":
PROPER1="Fort Leavenworth";
break;
case "lee":
PROPER1="Fort Lee";
break;
case "wood":
PROPER1="Fort Leonard Wood";
break;
case "lewis":
PROPER1="Fort Lewis";
break;
case "meade":
PROPER1="Fort Meade";
break;
case "polk":
PROPER1="Fort Polk";
break;
case "riley":
PROPER1="Fort Riley";
break;
case "rucker":
PROPER1="Fort Rucker";
break;
case "samhouston":
PROPER1="Fort Sam Houston";
break;
case "sill":
PROPER1="Fort Sill";
break;
case "stewart":
PROPER1="Fort Stewart";
break;
case "story":
PROPER1="Fort Story";
break;
case "wainwright":
PROPER1="Fort Wainwright";
break;
case "europe":
PROPER1="Europe";
break;
case "hawaii":
PROPER1="Hawaii";
break;
case "hunter":
PROPER1="Hunter AAF";
break;
case "korea":
PROPER1="Korea";
break;
case "westpoint":
PROPER1="USMA West Point";
break;
case "washington":
PROPER1="Washington DC";
break;
case "other":
PROPER1="Other";
break;

}
switch(month){
case "February07":
PROPER2="February 2007";
break;

case "January07":
PROPER2="January 2007";
break;

case "December06":
PROPER2="December 2006";
break;

case "November06":
PROPER2="November 2006";
break;

case "October06":
PROPER2="October 2006";
break;

case "September06":
PROPER2="September 2006";
break;

case "August06":
PROPER2="August 2006";
break;

case "July06":
PROPER2="July 2006";
break;

case "June06":
PROPER2="June 2006";
break;

case "May06":
PROPER2="May 2006";
break;

case "April06":
PROPER2="April 2006";
break;

case "March06":
PROPER2="March 2006";
break;

case "February06":
PROPER2="February 2006";
break;

case "January06":
PROPER2="January 2006";
break;

case "December05":
PROPER2="December 2005";
break;

case "November05":
PROPER2="November 2005";
break;

case "October05":
PROPER2="October 2005";
break;

case "September05":
PROPER2="September 2005";
break;

case "August05":
PROPER2="August 2005";
break;

case "July05":
PROPER2="July 2005";
break;

case "June05":
PROPER2="June 2005";
break;

case "May05":
PROPER2="May 2005";
break;

case "April05":
PROPER2="April 2005";
break;

case "March05":
PROPER2="March 2005";
break;

case "February05":
PROPER2="February 2005";
break;

case "January05":
PROPER2="January 2005";
break;

case "December04":
PROPER2="December 2004";
break;

case "November04":
PROPER2="November 2004";
break;

case "October04":
PROPER2="October 2004";
break;

case "September04":
PROPER2="September 2004";
break;

case "August04":
PROPER2="August 2004";
break;

case "July04":
PROPER2="July 2004";
break;

case "June04":
PROPER2="June 2004";
break;

case "May04":
PROPER2="May 2004";
break;

case "April04":
PROPER2="April 2004";
break;

case "March04":
PROPER2="March 2004";
break;

case "February04":
PROPER2="February 2004";
break;

case "January04":
PROPER2="January 2004";
break;

case "December03":
PROPER2="December 2003";
break;

case "November03":
PROPER2="November 2003";
break;

case "October03":
PROPER2="October 2003";
break;

case "September03":
PROPER2="September 2003";
break;

case "August03":
PROPER2="August 2003";
break;

case "July03":
PROPER2="July 2003";
break;

case "June03":
PROPER2="June 2003";
break;

case "May03":
PROPER2="May 2003";
break;
case "April03":
PROPER2="April 2003";
break;

case "March03":
PROPER2="March 2003";
break;

case "February03":
PROPER2="February 2003";
break;

case "January03":
PROPER2="January 2003";
break;

case "December02":
PROPER2="December 2002";
break;

case "November02":
PROPER2="November 2002";
break;

case "October02":
PROPER2="October 2002";
break;

case "September02":
PROPER2="September 2002";
break;
case "August02":
PROPER2="August 2002";
break;

case "July02":
PROPER2="July 2002";
break;

case "June02":
PROPER2="June 2002";
break;
case "May02":
PROPER2="May 2002";
break;

case "April02":
PROPER2="April 2002";
break;
case "March02":
PROPER2="March 2002";
break;

case "February02":
PROPER2="February 2002";
break;

case "January02":
PROPER2="January 2002";
break;
case "December01":
PROPER2 ="December 2001";
break;

case "November01":
PROPER2="November 2001";
break;
case "October01":
PROPER2="October 2001";
break;
}

<!-- Beginning of JavaScript -

function jumpToNewSite() {
self.location=
//document.open(document.Form2.jumpTo.options[document.Form2.jumpTo.selectedIndex]);
document.Form2.jumpTo.options[document.Form2.jumpTo.selectedIndex].value;

return false;
}

// - End of JavaScript - -->
</SCRIPT>

<CENTER><img border="0" src="../injurybanner.gif" width="471" height="60"><CENTER>

<script language="javascript">

document.write("<FORM METHOD=LINK ACTION=F2.htm>");
document.write("<p align=center><table width=339 align=center><tr><td width=132 align=left>");
document.write("<p align=left>Choose a Location:</p></td><td width=196 align=left>");
document.write("<select name=CAMPin onChange =submit() >");
document.write("<option value="+camp+">"+PROPER1+"<option value=army>Army All<option value=aberdeen>Aberdeen Prov. Ground <option value=belvoir>Fort Belvoir <option value=benning>Fort Benning<option value=bliss>Fort Bliss<option value=bragg>Fort Bragg<option value=campbell>Fort Campbell");
document.write("<option value=carson>Fort Carson<option value=drum>Fort Drum<option value=eustis>Fort Eustis<option value=gordon>Fort Gordon<option value=hood>Fort Hood<option value=huachuca>Fort Huachuca<option value=irwin>Fort Irwin");
document.write("<option value=jackson>Fort Jackson<option value=knox>Fort Knox<option value=leavenworth>Fort Leavenworth<option value=lee>Fort Lee<option value=wood>Fort Leonard Wood<option value=lewis>Fort Lewis<option value=meade>Fort Meade");
document.write("<option value=polk>Fort Polk<option value=riley>Fort Riley<option value=rucker>Fort Rucker<option value=samhouston>Fort Sam Houston<option value=sill>Fort Sill<option value=stewart>Fort Stewart<option value=story>Fort Story<option value=wainwright>Fort Wainwright");
document.write("<option value=europe>Europe<option value=hawaii>Hawaii<option value=hunter>Hunter AAF<option value=korea>Korea<option value=westpoint>USMA West Point<option value=washington>Washington DC </select>");

document.write("</td></tr><tr><td width=132 align=left> <p align=left>Choose a Report:&nbsp &nbsp</td><td width=196 align=left>");
document.write("<select name=MONTHin onChange=submit()><option value="+month+">"+PROPER2+" <option value=February07>February 2007<option value=January07>January 2007<option value=December06>December 2006<option value=November06>November 2006<option value=October06>October 2006<option value=September06>September 2006<option value=August06>August 2006<option value=July06>July 2006<option value=June06>June 2006<option value=May06>May 2006<option value=April06>April 2006<option value=March06>March 2006<option value=February06>February 2006<option value=January06>January 2006<option value=December05>December 2005<option value=November05>November 2005<option value=October05>October 2005<option value=September05>September 2005<option value=August05>August 2005<option value=July05>July 2005<option value=June05>June 2005<option value=May05>May 2005<option value=April05>April 2005<option value=March05>March 2005<option value=February05>February 2005<option value=January05>January 2005<option value=December04>December 2004<option value=November04>November 2004<option value=October04>October 2004<option value=September04>September 2004<option value=August04>August 2004<option value=July04>July 2004<option value=June04>June 2004<option value=May04>May 2004<option value=April04>April 2004<option value=March04>March 2004<option value=February04>February 2004<option value=January04>January 2004<option value=December03>December 2003<option value=November03>November 2003<option value=October03>October 2003<option value=September03>September 2003 <option value=August03>August 2003<option value=July03>July 2003<option value=June03>June 2003<option value=May03>May 2003<option value=April03>April 2003<option value=March03>March 2003<option value=February03>February 2003<option value=January03>January 2003<option value=December02>December 2002<option value=November02>November 2002<option value=October02>October 2002<option value=September02>September 2002<option value=August02>August 2002<option value=July02>July 2002<option value=June02>June 2002<option value=May02>May 2002<option value=April02>April 2002<option value=March02>March 2002<option value=February02>February 2002<option value=January02>January 2002 <option value=December01>December 2001 <option value=November01>November 2001 <option value=October01>October 2001</select>");


document.write("</td></tr></table>");
document.write("</Form>");


document.write("<center><td width=517><table border=0 cellpadding=12><tr>");
document.write(" <td align=center><strong><font size=2>");
document.write(" <a href="+ camp +"/"+ month +"/"+ camp +"1.pdf target=_top>Injury Trends </a></font></strong></td>");
document.write(" <td align=center><strong><font size=2><a href="+ camp +"/"+ month +"/"+ camp +"2.pdf target=_top>Causes of<br>");
document.write(" Serious Injury</a></font></strong></td>");
document.write("<td align=center><strong><font size=2><a href="+ camp +"/"+ month +"/"+ camp +"3.pdf target=_top>Medical<br>");
document.write(" Encounters</a></font></strong></td>");
document.write("<td align=center><strong><font size=2><a href="+ camp +"/"+ month +"/"+ camp +"4.pdf target=_top>Soldier<br>");
document.write(" Duty Status</a></font></strong></td>");
document.write("<td align=center><strong><font size=2><a href="+ camp +"/"+ month +"/"+ camp +".pdf target=_top>View<br>");
document.write("Entire Report</a></font></strong></td>");
document.write("</tr>");
document.write("<tr>");
document.write("<td align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +"1.pdf target=_top><img border=0 src=../injurytrends.gif width=77 height=97></a></strong></td>");
document.write("<td align=center>");
document.write(" <p align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +"2.pdf target=_top><img border=0 src=../causes.gif width=74 height=97></a></strong></td>");
document.write("<td align=center>");
document.write(" <p align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +"3.pdf target=_top><img border=0 src=../medical.gif width=73 height=97></a></strong></td>");
document.write(" <td align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +"4.pdf target=_top><img border=0 src=../last.gif width=75 height=97></a></strong></td>");
document.write(" <td align=center><strong><a href="+ camp +"/"+ month +"/"+ camp +".pdf target=_top><img border=0 src=../Front.gif width=74 height=97></a></strong></td>");
document.write("</tr></table><p align=center>&nbsp<p align=center>&nbsp</div></center><p align=center>&nbsp</p>");
document.write("</form>");

</script>

</center></center>

</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum