canadianjameson
11-09-2004, 04:56 AM
Hey.
Say i had a dynamic menu (selection in menu 1 defines the values shown in menu 2).
like so:
FULL FIXED, FUNCTIONAL CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT language=JavaScript type=text/JavaScript>
<!--
var Start_Array = new Array("Then choose a corresponding product");
var Null_Array = new Array("");
var Bindicator_Array = new Array("Now please select the desired product","--------------------------->","Phase Tracking Continuous level monitoring (Dry and Liquids)","Load Cells","Yo Yos");
var Greyline_Array = new Array("Now please select the desired product","--------------------------->","Ultrasonic Level Transmitters and Switches","Pump Station Level Control","Ultrasonic Tank Farm Level Systems","Open Channel Flow Monitors","Area-Velocity flow meters","Doppler Flow Meters","Transit Time flow meters");
var Intempco_Array = new Array("Now please select the desired product","--------------------------->","Temperature sensors (RTD\'s, Thermocouples, Thermowells)","Temperature transmitters; wire and connectors","RF Capacitance Level Switch and continuous probes","Humidity Sensors and Controllers, Wet bulb/Dry bulb","Data Acquisition");
var ITSnull_Array = new Array("");
var Babbit_Array = new Array("Now please select the desired product","--------------------------->","RF and Ultrasound Level switches","Broken Bag Detectors");
var Eurotron_Array = new Array("Now please select the desired product","--------------------------->","Calibrators (for Tc, RTD, ohms, mV, mA, V)","Combustion gas analyzers","Sample conditioners","Infrared thermometers");
var Smar_Array = new Array("Now please select the desired product","--------------------------->","Temperature and pressure transmitters (4/20+Hart+FIELDBUS), PLCs");
var Multifor_Array = new Array("Now please select the desired product","--------------------------->","Circuit board manufacturing - prototypes and small quantities. -> Fast delivery.","Thru-hole to surface mount conversion. Assembly available");
var Scaletron_Array = new Array("Now please select the desired product","--------------------------->","Silo weighing - load cells and strain guages","Batch control systems for dry bulk and liquid mixtures","RadarTron microwave moisture sensor for granular materials","Avanti concrete mixer","Crane Scales","Pallet Scales","Counting Scales");
var SivaNull_Array = new Array("");
var Chino_Array = new Array("Now please select the desired product","--------------------------->","Analog and hybrid temperature recorders and controllers","Radiation Thermometers");
var Delta_Array = new Array("Now please select the desired product","--------------------------->","Emission monitors","Dewpoint","Calorimeters","On-Line Liquid Analyzers");
var HayesClevland_Array = new Array("Now please select the desired product","--------------------------->","Programmable Controllers and Loop Controllers");
var Indumart_Array = new Array("Now please select the desired product","--------------------------->","Bar graph indicators with relays and RS-232 and 4-20mA retransmitters.","Pressure gauges and transmitters","Thermometers","Signal conditioning","Pneumatic controller and recorder");
var JUMO_Array = new Array("Now please select the desired product","--------------------------->","PH/Redox: Sensors, Transmitters, and Controllers","Dissolved oxygen measurement","CL / CL02 ozone and hydrogren peroxide measurement");
var Reigl_Array = new Array("Now please select the desired product","--------------------------->","Laser distance sensors","2D & 3D Scanners");
var Siva_Array = new Array("Now please select the desired product","--------------------------->","Valve manifolds:","-> 1 to 5 valve","-> Needle","-> Ball and gauge manifolds","-> Headers");
var TTI_Array = new Array("Now please select the desired product","--------------------------->","Calibration Equipment","Emissions control and montitoring","Data Loggers"," ","Fuji","------->","Transit time flow meters - fixed and portable","Chart recorders","Controllers");
var MiscNull_Array = new Array("");
var Bebco_Array = new Array("Now please select the desired product","--------------------------->","Enclosure Protection Systems","Building Pressurization Systems","Purged Industrial Shelters","Wall Mounted Air Conditioning");
var HaxPneumatics_Array = new Array("Now please select the desired product","--------------------------->","Dry bulk flow controllers","Gain-in-Weight and Loss-in-Weight feeders","Non contact Motion Meter");
var PrecisionDigital_Array = new Array("Now please select the desired product","--------------------------->","Digital Panel Meters - Universal Process Meter","mV Meter","Flow totalizer & Tachometer/Rate Meter","Loop-powered meters","4 Point annunciator");
var Proceco_Array = new Array("Now please select the desired product","--------------------------->","Parts washers");
var Reimelt_Array = new Array("Now please select the desired product","--------------------------->","Silos","Discharge systems","Bagging equipment","Conveying, Metering, Grinding, Shifting, and Weighing equipment","Automation");
var Sirco_Array = new Array("Now please select the desired product","--------------------------->","Indoor Stationary water samplers","Outdoor Stationary water samplers","Portable water samplers");
var Strongwell_Array = new Array("Now please select the desired product","--------------------------->","Fiberglass (FRP) structures and systems:","-> Fiberglass Gritted Plate","-> Fiberglass Structures","-> Fiberglass Structural Shapes and Plate","-> Fiberglass Gratings","-> Molded Fiberglass Gratings","-> Fiberglass Handrails and Ladders","-> Fiberglass Studs and nuts","-> Fiberglass Building panels","-> Foam Core Building panels","-> Fiberglass Flooring and decking","-> Baffle Panels");
function refill_Product(objProducer) {
var objProduct = objProducer.form.Product;
var selectedArray = window[objProducer.options[objProducer.selectedIndex].value.replace(/\s/g,'') + "_Array"];
objProduct.options.length = 0;
for (var i=0; i < selectedArray.length; i++) {
objProduct.options[i]=new Option(selectedArray[i], selectedArray[i].replace(/->\s/g, ""));
}
}
// End -->
</script>
</head>
<body onload="refill_Product(document.productchoice.Producer)">
<form name="productchoice">
<select name="Producer" onchange="refill_Product(this)">
<option value="Start">Please choose a company</option>
<option value=Null>---------------------------------------></option>
<option value="Bindicator">Bindicator (Celtek Electronics)</option>
<option value="Greyline">Greyline<\/option>
<option value="Intempco">Intempco Controls</option>
<option value=ITSnull>ITS</option>
<option value="Babbit"> -> Babbit</option>
<option value="Eurotron"> -> Eurotron</option>
<option value="Smar"> -> Smar</option>
<option value="Multifor">Multifor</option>
<option value="Scaletron">Scaletron</option>
<option value=SivaNull>Siva</option>
<option value="Chino"> -> Chino</option>
<option value="Delta"> -> Delta</option>
<option value="Hayes Clevland"> -> Hayes Clevland</option>
<option value="Indumart"> -> Indumart</option>
<option value="JUMO"> -> JUMO</option>
<option value="Reigl"> -> Reigl</option>
<option value="Siva"> -> Siva</option>
<option value="TTI"> -> TTI</option>
<option value=MiscNull>Misc.</option>
<option value="Bebco"> -> Bebco</option>
<option value="Hax Pneumatics"> -> Hax Pneumatics</option>
<option value="Precision Digital"> -> Precision Digital</option>
<option value="Proceco"> -> Proceco</option>
<option value="Reimelt"> -> Reimelt</option>
<option value="Sirco"> -> Sirco</option>
<option value="Strongwell"> -> Strongwell</option>
</select>
<p>
<select name="Product" onChange="" size="1" style="width:450; background-color: white;" tabindex="2">
<!-- option value=""><-----------</option -->
</select>
</form>
</body>
</html>
And say i wanted to display a link based on the value selected in menu 2
like so:
function openInfo(objProduct){
var optVal = objProduct.options[objProduct.selectedIndex].value;
if (optVal != " " && optVal.indexOf("------->") == -1){
optVal = optVal.replace(/(\s)|(\/)/g, "_");
var win = window.open("info/" + optVal + "_info.htm", "infoPop", "toolbar=0, width=475, height=200, left=300, top=300");
win.focus();
}
else alert("Please choose a product.");
return false;
}
...
<select name="Product" ...>
...
</select>
<input type="button" value="More Info" onclick="openInfo(this.form.Product)" />
<a href="#" onclick="return openInfo(document.productchoice.Product)">More Info</a>
I'd be happy.
The only issue would be that according to the script above, i would have to name my links as follows:
Phase Tracking Continuous level monitoring (Dry and Liquids)
would have to be
Phase_Tracking_Continuous_level_monitoring_(Dry_and_Liquids)_info.htm
...
all fine and dandy i suppose.
That being said, it would be EXTREMELY advantageous to me if i could do the following:
instead of having to name each file according to the menu... i propose the following. Can i have the script above which displays the link based on the 2nd menu selection GRAB the path of the file from an array?
like so:
var url {
"Phase Tracking Continuous level monitoring (Dry and Liquids)".src = info/phase.htm;
"Ultrasonic Level Transmitters and Switches".src = info/ultrasonic.htm;
"...etc"
}
How would i do this? How would i modify the middle script to look for the path of the file in the array url
Thanks a lot in advance. And especially, thanks to those who've gotten me this far :)
Say i had a dynamic menu (selection in menu 1 defines the values shown in menu 2).
like so:
FULL FIXED, FUNCTIONAL CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT language=JavaScript type=text/JavaScript>
<!--
var Start_Array = new Array("Then choose a corresponding product");
var Null_Array = new Array("");
var Bindicator_Array = new Array("Now please select the desired product","--------------------------->","Phase Tracking Continuous level monitoring (Dry and Liquids)","Load Cells","Yo Yos");
var Greyline_Array = new Array("Now please select the desired product","--------------------------->","Ultrasonic Level Transmitters and Switches","Pump Station Level Control","Ultrasonic Tank Farm Level Systems","Open Channel Flow Monitors","Area-Velocity flow meters","Doppler Flow Meters","Transit Time flow meters");
var Intempco_Array = new Array("Now please select the desired product","--------------------------->","Temperature sensors (RTD\'s, Thermocouples, Thermowells)","Temperature transmitters; wire and connectors","RF Capacitance Level Switch and continuous probes","Humidity Sensors and Controllers, Wet bulb/Dry bulb","Data Acquisition");
var ITSnull_Array = new Array("");
var Babbit_Array = new Array("Now please select the desired product","--------------------------->","RF and Ultrasound Level switches","Broken Bag Detectors");
var Eurotron_Array = new Array("Now please select the desired product","--------------------------->","Calibrators (for Tc, RTD, ohms, mV, mA, V)","Combustion gas analyzers","Sample conditioners","Infrared thermometers");
var Smar_Array = new Array("Now please select the desired product","--------------------------->","Temperature and pressure transmitters (4/20+Hart+FIELDBUS), PLCs");
var Multifor_Array = new Array("Now please select the desired product","--------------------------->","Circuit board manufacturing - prototypes and small quantities. -> Fast delivery.","Thru-hole to surface mount conversion. Assembly available");
var Scaletron_Array = new Array("Now please select the desired product","--------------------------->","Silo weighing - load cells and strain guages","Batch control systems for dry bulk and liquid mixtures","RadarTron microwave moisture sensor for granular materials","Avanti concrete mixer","Crane Scales","Pallet Scales","Counting Scales");
var SivaNull_Array = new Array("");
var Chino_Array = new Array("Now please select the desired product","--------------------------->","Analog and hybrid temperature recorders and controllers","Radiation Thermometers");
var Delta_Array = new Array("Now please select the desired product","--------------------------->","Emission monitors","Dewpoint","Calorimeters","On-Line Liquid Analyzers");
var HayesClevland_Array = new Array("Now please select the desired product","--------------------------->","Programmable Controllers and Loop Controllers");
var Indumart_Array = new Array("Now please select the desired product","--------------------------->","Bar graph indicators with relays and RS-232 and 4-20mA retransmitters.","Pressure gauges and transmitters","Thermometers","Signal conditioning","Pneumatic controller and recorder");
var JUMO_Array = new Array("Now please select the desired product","--------------------------->","PH/Redox: Sensors, Transmitters, and Controllers","Dissolved oxygen measurement","CL / CL02 ozone and hydrogren peroxide measurement");
var Reigl_Array = new Array("Now please select the desired product","--------------------------->","Laser distance sensors","2D & 3D Scanners");
var Siva_Array = new Array("Now please select the desired product","--------------------------->","Valve manifolds:","-> 1 to 5 valve","-> Needle","-> Ball and gauge manifolds","-> Headers");
var TTI_Array = new Array("Now please select the desired product","--------------------------->","Calibration Equipment","Emissions control and montitoring","Data Loggers"," ","Fuji","------->","Transit time flow meters - fixed and portable","Chart recorders","Controllers");
var MiscNull_Array = new Array("");
var Bebco_Array = new Array("Now please select the desired product","--------------------------->","Enclosure Protection Systems","Building Pressurization Systems","Purged Industrial Shelters","Wall Mounted Air Conditioning");
var HaxPneumatics_Array = new Array("Now please select the desired product","--------------------------->","Dry bulk flow controllers","Gain-in-Weight and Loss-in-Weight feeders","Non contact Motion Meter");
var PrecisionDigital_Array = new Array("Now please select the desired product","--------------------------->","Digital Panel Meters - Universal Process Meter","mV Meter","Flow totalizer & Tachometer/Rate Meter","Loop-powered meters","4 Point annunciator");
var Proceco_Array = new Array("Now please select the desired product","--------------------------->","Parts washers");
var Reimelt_Array = new Array("Now please select the desired product","--------------------------->","Silos","Discharge systems","Bagging equipment","Conveying, Metering, Grinding, Shifting, and Weighing equipment","Automation");
var Sirco_Array = new Array("Now please select the desired product","--------------------------->","Indoor Stationary water samplers","Outdoor Stationary water samplers","Portable water samplers");
var Strongwell_Array = new Array("Now please select the desired product","--------------------------->","Fiberglass (FRP) structures and systems:","-> Fiberglass Gritted Plate","-> Fiberglass Structures","-> Fiberglass Structural Shapes and Plate","-> Fiberglass Gratings","-> Molded Fiberglass Gratings","-> Fiberglass Handrails and Ladders","-> Fiberglass Studs and nuts","-> Fiberglass Building panels","-> Foam Core Building panels","-> Fiberglass Flooring and decking","-> Baffle Panels");
function refill_Product(objProducer) {
var objProduct = objProducer.form.Product;
var selectedArray = window[objProducer.options[objProducer.selectedIndex].value.replace(/\s/g,'') + "_Array"];
objProduct.options.length = 0;
for (var i=0; i < selectedArray.length; i++) {
objProduct.options[i]=new Option(selectedArray[i], selectedArray[i].replace(/->\s/g, ""));
}
}
// End -->
</script>
</head>
<body onload="refill_Product(document.productchoice.Producer)">
<form name="productchoice">
<select name="Producer" onchange="refill_Product(this)">
<option value="Start">Please choose a company</option>
<option value=Null>---------------------------------------></option>
<option value="Bindicator">Bindicator (Celtek Electronics)</option>
<option value="Greyline">Greyline<\/option>
<option value="Intempco">Intempco Controls</option>
<option value=ITSnull>ITS</option>
<option value="Babbit"> -> Babbit</option>
<option value="Eurotron"> -> Eurotron</option>
<option value="Smar"> -> Smar</option>
<option value="Multifor">Multifor</option>
<option value="Scaletron">Scaletron</option>
<option value=SivaNull>Siva</option>
<option value="Chino"> -> Chino</option>
<option value="Delta"> -> Delta</option>
<option value="Hayes Clevland"> -> Hayes Clevland</option>
<option value="Indumart"> -> Indumart</option>
<option value="JUMO"> -> JUMO</option>
<option value="Reigl"> -> Reigl</option>
<option value="Siva"> -> Siva</option>
<option value="TTI"> -> TTI</option>
<option value=MiscNull>Misc.</option>
<option value="Bebco"> -> Bebco</option>
<option value="Hax Pneumatics"> -> Hax Pneumatics</option>
<option value="Precision Digital"> -> Precision Digital</option>
<option value="Proceco"> -> Proceco</option>
<option value="Reimelt"> -> Reimelt</option>
<option value="Sirco"> -> Sirco</option>
<option value="Strongwell"> -> Strongwell</option>
</select>
<p>
<select name="Product" onChange="" size="1" style="width:450; background-color: white;" tabindex="2">
<!-- option value=""><-----------</option -->
</select>
</form>
</body>
</html>
And say i wanted to display a link based on the value selected in menu 2
like so:
function openInfo(objProduct){
var optVal = objProduct.options[objProduct.selectedIndex].value;
if (optVal != " " && optVal.indexOf("------->") == -1){
optVal = optVal.replace(/(\s)|(\/)/g, "_");
var win = window.open("info/" + optVal + "_info.htm", "infoPop", "toolbar=0, width=475, height=200, left=300, top=300");
win.focus();
}
else alert("Please choose a product.");
return false;
}
...
<select name="Product" ...>
...
</select>
<input type="button" value="More Info" onclick="openInfo(this.form.Product)" />
<a href="#" onclick="return openInfo(document.productchoice.Product)">More Info</a>
I'd be happy.
The only issue would be that according to the script above, i would have to name my links as follows:
Phase Tracking Continuous level monitoring (Dry and Liquids)
would have to be
Phase_Tracking_Continuous_level_monitoring_(Dry_and_Liquids)_info.htm
...
all fine and dandy i suppose.
That being said, it would be EXTREMELY advantageous to me if i could do the following:
instead of having to name each file according to the menu... i propose the following. Can i have the script above which displays the link based on the 2nd menu selection GRAB the path of the file from an array?
like so:
var url {
"Phase Tracking Continuous level monitoring (Dry and Liquids)".src = info/phase.htm;
"Ultrasonic Level Transmitters and Switches".src = info/ultrasonic.htm;
"...etc"
}
How would i do this? How would i modify the middle script to look for the path of the file in the array url
Thanks a lot in advance. And especially, thanks to those who've gotten me this far :)