PDA

View Full Version : Drop-Down Box Menu


rhayden
08-11-2009, 04:23 PM
I'm a novice coder - very little experience with Javascript. My problem is with the Drop-Down boxes not working properly. I have mulitple drop-down boxes on a page and what I would like is for the user to be able to select a project and that folder that is on a dvd comes up in windows explorer. I have the working, but when I add the javascript for the second drop-down box the first DDB starts using the 2nd DDB script. How do I force the first DDB to use it's script and not the 2nd DDB script. I hope that makes since. Below is some of my code for the first two DDB.

Thanks,

Rick

<p class="style8"><strong>Hospital Projects</strong></p>
<form>
<p><select name="First Floor Projects" style="width: 355px" language="javascript" onChange="gotoPage(this.selectedIndex);">
<option>First Floor Projects</option>
<option>-----------------------------------------</option>
<option>CC1-122 - Hospital Morgue - Room 11148</option>
<option>CC12-265 - Room 11126 Exhaust</option>
<option>DD3-161 - Lab in Imaging Waiting Area Room 11070</option>
<option>DD9-108 - Dietry Corridor</option>
<option>082-156-E - Emergency Room Renovations</option>
<option>086-216-E - CT Scan Room 11059</option>
<option>-----------------------------------------</option>
<option>Second Floor Projects</option>
<option>-----------------------------------------</option>
<option>BB12-274 - Cath Lab 1 Build Out</option>
<option>088-258-E Cath Lab No. 4</option>
<option>-----------------------------------------</option>
<option>Fourth Floor Projects</option>
<option>-----------------------------------------</option>
<option>082-160-E - Pediatrics Additional Patient Rooms</option>
<option>-----------------------------------------</option>
<option>Sixth Floor Projects</option>
<option>-----------------------------------------</option>
<option>BB6-177 - 6th Floor Joint Camp</option>
</select>
</p>
</form>
<script language="JavaScript">
<!--
function gotoPage(varItem)
{
switch(varItem)
{
case 0:
window.parent.self.status="Goes Nowhere";
break;
case 1:
window.parent.self.status="Goes Nowhere";
break;
case 2:
window.location="file:///d:/Dgh/1st%20Floor/CC1-122%20Hospital%20Morgue";
break;
case 3:
window.location="../Dgh/1st%20Floor/CC12-265%20Room%2011126%20Exhaust";
break;
case 4:
window.location="file:///D:/Dgh/1st%20Floor/DD3-161%20DGH%20-%20Lab%20in%20Imaging%20Waiting%20Area";
break;
case 5:
window.location="file:///D:/Dgh/1st%20Floor/DD9-208%20Dgh-dietry%20Corridor";
break;
case 6:
window.location="file:///D:/Dgh/1st%20Floor/082-156-E%20DGH%20-%20Emergency%20Rm%20Renov";
break;
case 7:
window.location="file:///D:/Dgh/1st%20Floor/086-216-E%20DGH-ct%20Scan%20Room%2011059";
break;
case 8:
window.location="Goes Nowhere";
break;
case 9:
window.location="Goes Nowhere";
break;
case 10:
window.location="Goes Nowhere";
break;
case 11:
window.location="file:///D:/Dgh/2nd%20Floor/Cath%20Lab%201%20Build%20Out/";
break;
case 12:
window.location="file:///d:/Dgh/2nd%20Floor/088-258-E%20Dgh%20Cath%20lab%20No.%204";
break;
case 13:
window.location="Goes Nowhere";
break;
case 14:
window.location="Goes Nowhere";
break;
case 15:
window.location="Goes Nowhere";
break;
case 16:
window.location="file:///d:/Dgh/4th%20Floor/082-160-E%20DGH%204th%20Floor%20Pediatrics%20Additional%20Patient%20Rooms";
break;
case 17:
window.location="Goes Nowhere";
break;
case 18:
window.location="Goes Nowhere";
break;
case 19:
window.location="Goes Nowhere";
break;
case 20:
window.location="file:///D:/Dgh/6th%20Floor/BB6-177%20Hospital%206th%20Flr%20Joint%20Camp/";
break;
}
}
// -->
</script>
<p><form>
<select name="Misc. Hospital Projects" style="width: 355px" language="javascript" onChange="gotoPage(this.selectedIndex);">
<option>Misc. Hospital Projects</option>
<option>------------------------------------</option>
<option>AA1-113 - Hospital</option>
<option>BB4-134 - Patient Tower Fascade Lighting</option>
<option>BB5-152 - Trash Compactors</option>
<option>BB7-193 - Owner Room Numbering Scheme</option>
<option>BB8-200 - Biohazard Cooler</option>
<option>BB10-224 - Firewall Graphics</option>
<option>BB11-258 - New Hospital Elec. Documentation</option>
<option>BB12-266 - Fire Alarm Documentation</option>
<option>BB12-269 - Employee Orientation Graphics</option>
<option>086-219-E - DGH - Infection Control Risk Graphics</option>
</select>
</form></p>
<script language="JavaScript">
<!--
function gotoPage(varItem)
{
switch(varItem)
{
case 0:
window.parent.self.status="Goes Nowhere";
break;
case 1:
window.parent.self.status="Goes Nowhere";
break;
case 2:
window.location="file:///D:/Dgh/AA1-113%20-%20Hospital/";
break;
case 3:
window.location="file:///D:/Dgh/BB4-134%20Patient%20Tower%20Fascade%20Lighting/";
break;
case 4:
window.location="file:///D:/Dgh/BB5-152%20Trash%20Compactors/";
break;
case 5:
window.location="file:///D:/Dgh/BB7-193%20DGH%20Owner%20Room%20Numbering%20Scheme/";
break;
case 6:
window.location="file:///D:/Dgh/BB8-200%20Biohazard%20Cooler/";
break;
case 7:
window.location="file:///D:/Dgh/BB10-224%20Firewall%20Graphics/";
break;
case 8:
window.location="file:///D:/Dgh/BB11-258%20New%20Hospital%20Elec%20Documentation/";
break;
case 9:
window.location="file:///D:/Dgh/BB12-266-%20New%20Hosp%20Fire%20Alarm%20Documentation/";
break;
case 10:
window.location="file:///D:/Dgh/BB12-269%20Employee%20Orientation%20Graphics/";
break;
case 11:
window.location="file:///D:/Dgh/086-219-E%20DGH%20-%20Infection%20Control%20Risk%20Graphics/";
break;
}
}
// -->
</script>

rhayden
08-11-2009, 05:09 PM
Sorry I just realized I posted this in the wrong section.