robertsont
08-17-2004, 07:19 AM
I can't seem to make these multiple drop boxes occur twice on a page. Simply duplicating the script in the <body> does not seem to work - what parts do i need to change?
Regards,
Tom
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Free JavaScripts provided by The JavaScript Source</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: Andrew Berry (aberry@berrysystems.com) -->
<!-- Web Site: http://www.berrysystems.com -->
<!-- Begin
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();
arrItems1[3] = "Cellular";
arrItemsGrp1[3] = 1;
arrItems1[4] = "Telecom Equipment";
arrItemsGrp1[4] = 1;
arrItems1[5] = "Optical Networking";
arrItemsGrp1[5] = 1;
arrItems1[8] = "Home Networking";
arrItemsGrp1[8] = 1;
arrItems1[9] = "Streaming Media";
arrItemsGrp1[9] = 1;
arrItems1[6] = "Enterprise Software";
arrItemsGrp1[6] = 2;
arrItems1[7] = "Security";
arrItemsGrp1[7] = 2;
arrItems1[10] = "Storage & Data Centres";
arrItemsGrp1[10] = 2;
arrItems1[0] = "Storage";
arrItemsGrp1[0] = 3;
arrItems1[1] = "Industrial & Consumer Goods";
arrItemsGrp1[1] = 3;
arrItems1[2] = "Supporting Products";
arrItemsGrp1[2] = 3;
arrItems1[11] = "Telecom";
arrItemsGrp1[11] = 3;
arrItems1[12] = "Clients";
arrItemsGrp1[12] = 4;
arrItems1[13] = "Web Services";
arrItemsGrp1[13] = 4;
arrItems1[14] = "Marketing";
arrItemsGrp1[14] = 4;
arrItems1[15] = "Communication";
arrItemsGrp1[15] = 4;
arrItems1[16] = "Commerce";
arrItemsGrp1[16] = 4;
arrItems1[17] = "Biotechnology";
arrItemsGrp1[17] = 5;
arrItems1[18] = "Medical Devices";
arrItemsGrp1[18] = 5;
arrItems1[19] = "Print & Scanning";
arrItemsGrp1[19] = 6;
arrItems1[20] = "Components";
arrItemsGrp1[20] = 6;
arrItems1[23] = "Industry";
arrItemsGrp1[23] = 6;
arrItems1[24] = "Consumer & Enterprise Electronics";
arrItemsGrp1[24] = 6;
var arrItems2 = new Array();
var arrItemsGrp2 = new Array();
arrItems2[21] = "Infiniband";
arrItemsGrp2[21] = 0
arrItems2[22] = "Storage Sub-Systems";
arrItemsGrp2[22] = 0
arrItems2[75] = "Systems & Hardware";
arrItemsGrp2[75] = 0
arrItems2[31] = "Automotive";
arrItemsGrp2[31] = 1
arrItems2[34] = "Electric Goods";
arrItemsGrp2[34] = 1
arrItems2[76] = "Display";
arrItemsGrp2[76] = 1
arrItems2[35] = "Design & Tools";
arrItemsGrp2[35] = 2
arrItems2[77] = "Packaging";
arrItemsGrp2[77] = 2
arrItems2[78] = "Cooling";
arrItemsGrp2[78] = 2
arrItems2[79] = "Home Networking & LAN";
arrItemsGrp2[79] = 11
arrItems2[80] = "Core Networks";
arrItemsGrp2[80] = 11
arrItems2[81] = "Optical Components";
arrItemsGrp2[81] = 11
arrItems2[82] = "Wireless";
arrItemsGrp2[82] = 11
arrItems2[99] = "Components";
arrItemsGrp2[99] = 5
arrItems2[100] = "Sub-System";
arrItemsGrp2[100] = 5
arrItems2[57] = "Sub-Components";
arrItemsGrp2[57] = 5
arrItems2[27] = "System";
arrItemsGrp2[27] = 5
arrItems2[101] = "Internet Applications";
arrItemsGrp2[101] = 3
arrItems2[102] = "Core Network";
arrItemsGrp2[102] = 3
arrItems2[24] = "Cellular Applications";
arrItemsGrp2[24] = 3
arrItems2[25] = "Handheld Components";
arrItemsGrp2[25] = 3
arrItems2[103] = "Access";
arrItemsGrp2[103] = 4
arrItems2[104] = "Datacom";
arrItemsGrp2[104] = 4
arrItems2[26] = "Network Backbone & Metro";
arrItemsGrp2[26] = 4
arrItems2[105] = "eBusiness Operations";
arrItemsGrp2[105] = 6
arrItems2[106] = "Internal Operations";
arrItemsGrp2[106] = 6
arrItems2[67] = "Technical Operations";
arrItemsGrp2[67] = 6
arrItems2[68] = "Front-desk Operations";
arrItemsGrp2[68] = 6
arrItems2[200] = "File Protection";
arrItemsGrp2[200] = 7
arrItems2[201] = "Secure Networks";
arrItemsGrp2[201] = 7
arrItems2[203] = "Secure Transactions";
arrItemsGrp2[203] = 7
arrItems2[69] = "Wireless & Mobile";
arrItemsGrp2[69] = 7
arrItems2[58] = "Residential Access";
arrItemsGrp2[58] = 8
arrItems2[59] = "Wireless Networking";
arrItemsGrp2[59] = 8
arrItems2[60] = "Residential Gateway";
arrItemsGrp2[60] = 8
arrItems2[61] = "Wired Networking";
arrItemsGrp2[61] = 8
arrItems2[62] = "Customer Premises Equipment";
arrItemsGrp2[62] = 9
arrItems2[63] = "Broadcast Equipment";
arrItemsGrp2[63] = 9
arrItems2[64] = "Enabling Technologies";
arrItemsGrp2[64] = 9
arrItems2[65] = "Internet";
arrItemsGrp2[65] = 9
arrItems2[66] = "Mobile & PDA";
arrItemsGrp2[66] = 9
arrItems2[70] = "Infiniband";
arrItemsGrp2[70] = 10
arrItems2[71] = "Storage Sub-Systems";
arrItemsGrp2[71] = 10
arrItems2[72] = "System Area Network";
arrItemsGrp2[72] = 10
arrItems2[73] = "Systems & Hardware";
arrItemsGrp2[73] = 10
arrItems2[74] = "Storage Software";
arrItemsGrp2[74] = 10
arrItems2[85] = "Browser Add-Ons";
arrItemsGrp2[85] = 12
arrItems2[86] = "Stand-alone Software";
arrItemsGrp2[86] = 12
arrItems2[89] = "Media";
arrItemsGrp2[89] = 13
arrItems2[90] = "Content Management";
arrItemsGrp2[90] = 13
arrItems2[91] = "Industries";
arrItemsGrp2[91] = 13
arrItems2[87] = "Advertising";
arrItemsGrp2[87] = 14
arrItems2[88] = "Customer Relationship";
arrItemsGrp2[88] = 14
arrItems2[92] = "Cellular";
arrItemsGrp2[92] = 15
arrItems2[93] = "Messaging";
arrItemsGrp2[93] = 15
arrItems2[94] = "VOIP";
arrItemsGrp2[94] = 15
arrItems2[95] = "Billing";
arrItemsGrp2[95] = 16
arrItems2[96] = "Comparison Shopping";
arrItemsGrp2[96] = 16
arrItems2[97] = "Marketplace";
arrItemsGrp2[97] = 16
arrItems2[98] = "3D & Imaging";
arrItemsGrp2[98] = 16
arrItems2[108] = "Diagnosis";
arrItemsGrp2[108] = 17
arrItems2[109] = "Laboratory Tools";
arrItemsGrp2[109] = 17
arrItems2[110] = "Bio-Agro & Food Flavour";
arrItemsGrp2[110] = 17
arrItems2[111] = "Treatment";
arrItemsGrp2[111] = 17
arrItems2[112] = "Platforms for Drug Research";
arrItemsGrp2[112] = 17
arrItems2[113] = "Monitoring";
arrItemsGrp2[113] = 18
arrItems2[114] = "Imaging & Visualisation";
arrItemsGrp2[114] = 18
arrItems2[115] = "IT & Training";
arrItemsGrp2[115] = 18
arrItems2[116] = "Invasive Therapy";
arrItemsGrp2[116] = 18
arrItems2[117] = "Non-Invasive Therapy";
arrItemsGrp2[117] = 18
arrItems2[118] = "3D Modeling";
arrItemsGrp2[118] = 19
arrItems2[119] = "Printing Machines";
arrItemsGrp2[119] = 19
arrItems2[120] = "Fab Inspection";
arrItemsGrp2[120] = 20
arrItems2[121] = "Fab Process Enabling";
arrItemsGrp2[121] = 20
arrItems2[122] = "Fab Process Management";
arrItemsGrp2[122] = 20
arrItems2[123] = "Optical";
arrItemsGrp2[123] = 20
arrItems2[124] = "PCB";
arrItemsGrp2[124] = 20
arrItems2[125] = "Nano Materials";
arrItemsGrp2[125] = 23
arrItems2[126] = "Measurement & Inspection";
arrItemsGrp2[126] = 23
arrItems2[127] = "Humidity Management";
arrItemsGrp2[127] = 23
arrItems2[128] = "Power Management";
arrItemsGrp2[128] = 23
arrItems2[129] = "Other";
arrItemsGrp2[129] = 23
arrItems2[130] = "Screens";
arrItemsGrp2[130] = 24
arrItems2[131] = "Surveillance & Security";
arrItemsGrp2[131] = 24
arrItems2[132] = "Other";
arrItemsGrp2[132] = 24
function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
if (control.name == "firstChoice") {
// Empty the third drop down box of any choices
for (var q=myChoices.thirdChoice.options.length;q>=0;q--) myChoices.thirdChoice.options[q] = null;
}
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>
</head>
<body>
<form name=myChoices>
<table align="center">
<tr>
<td>
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this, myChoices.secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Telecommunications</option>
<option value=2>Information Technology</option>
<option value=3>Components</option>
<option value=4>Internet</option>
<option value=5>Life Sciences</option>
<option value=6>Capital Equipment</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice onchange="selectChange(this, myChoices.thirdChoice, arrItems2, arrItemsGrp2);">
</SELECT>
<SELECT id=thirdChoice name=thirdChoice>
</SELECT>
</TD>
</TR>
</TABLE>
</form>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
</body>
</html>
Regards,
Tom
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Free JavaScripts provided by The JavaScript Source</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Original: Andrew Berry (aberry@berrysystems.com) -->
<!-- Web Site: http://www.berrysystems.com -->
<!-- Begin
var arrItems1 = new Array();
var arrItemsGrp1 = new Array();
arrItems1[3] = "Cellular";
arrItemsGrp1[3] = 1;
arrItems1[4] = "Telecom Equipment";
arrItemsGrp1[4] = 1;
arrItems1[5] = "Optical Networking";
arrItemsGrp1[5] = 1;
arrItems1[8] = "Home Networking";
arrItemsGrp1[8] = 1;
arrItems1[9] = "Streaming Media";
arrItemsGrp1[9] = 1;
arrItems1[6] = "Enterprise Software";
arrItemsGrp1[6] = 2;
arrItems1[7] = "Security";
arrItemsGrp1[7] = 2;
arrItems1[10] = "Storage & Data Centres";
arrItemsGrp1[10] = 2;
arrItems1[0] = "Storage";
arrItemsGrp1[0] = 3;
arrItems1[1] = "Industrial & Consumer Goods";
arrItemsGrp1[1] = 3;
arrItems1[2] = "Supporting Products";
arrItemsGrp1[2] = 3;
arrItems1[11] = "Telecom";
arrItemsGrp1[11] = 3;
arrItems1[12] = "Clients";
arrItemsGrp1[12] = 4;
arrItems1[13] = "Web Services";
arrItemsGrp1[13] = 4;
arrItems1[14] = "Marketing";
arrItemsGrp1[14] = 4;
arrItems1[15] = "Communication";
arrItemsGrp1[15] = 4;
arrItems1[16] = "Commerce";
arrItemsGrp1[16] = 4;
arrItems1[17] = "Biotechnology";
arrItemsGrp1[17] = 5;
arrItems1[18] = "Medical Devices";
arrItemsGrp1[18] = 5;
arrItems1[19] = "Print & Scanning";
arrItemsGrp1[19] = 6;
arrItems1[20] = "Components";
arrItemsGrp1[20] = 6;
arrItems1[23] = "Industry";
arrItemsGrp1[23] = 6;
arrItems1[24] = "Consumer & Enterprise Electronics";
arrItemsGrp1[24] = 6;
var arrItems2 = new Array();
var arrItemsGrp2 = new Array();
arrItems2[21] = "Infiniband";
arrItemsGrp2[21] = 0
arrItems2[22] = "Storage Sub-Systems";
arrItemsGrp2[22] = 0
arrItems2[75] = "Systems & Hardware";
arrItemsGrp2[75] = 0
arrItems2[31] = "Automotive";
arrItemsGrp2[31] = 1
arrItems2[34] = "Electric Goods";
arrItemsGrp2[34] = 1
arrItems2[76] = "Display";
arrItemsGrp2[76] = 1
arrItems2[35] = "Design & Tools";
arrItemsGrp2[35] = 2
arrItems2[77] = "Packaging";
arrItemsGrp2[77] = 2
arrItems2[78] = "Cooling";
arrItemsGrp2[78] = 2
arrItems2[79] = "Home Networking & LAN";
arrItemsGrp2[79] = 11
arrItems2[80] = "Core Networks";
arrItemsGrp2[80] = 11
arrItems2[81] = "Optical Components";
arrItemsGrp2[81] = 11
arrItems2[82] = "Wireless";
arrItemsGrp2[82] = 11
arrItems2[99] = "Components";
arrItemsGrp2[99] = 5
arrItems2[100] = "Sub-System";
arrItemsGrp2[100] = 5
arrItems2[57] = "Sub-Components";
arrItemsGrp2[57] = 5
arrItems2[27] = "System";
arrItemsGrp2[27] = 5
arrItems2[101] = "Internet Applications";
arrItemsGrp2[101] = 3
arrItems2[102] = "Core Network";
arrItemsGrp2[102] = 3
arrItems2[24] = "Cellular Applications";
arrItemsGrp2[24] = 3
arrItems2[25] = "Handheld Components";
arrItemsGrp2[25] = 3
arrItems2[103] = "Access";
arrItemsGrp2[103] = 4
arrItems2[104] = "Datacom";
arrItemsGrp2[104] = 4
arrItems2[26] = "Network Backbone & Metro";
arrItemsGrp2[26] = 4
arrItems2[105] = "eBusiness Operations";
arrItemsGrp2[105] = 6
arrItems2[106] = "Internal Operations";
arrItemsGrp2[106] = 6
arrItems2[67] = "Technical Operations";
arrItemsGrp2[67] = 6
arrItems2[68] = "Front-desk Operations";
arrItemsGrp2[68] = 6
arrItems2[200] = "File Protection";
arrItemsGrp2[200] = 7
arrItems2[201] = "Secure Networks";
arrItemsGrp2[201] = 7
arrItems2[203] = "Secure Transactions";
arrItemsGrp2[203] = 7
arrItems2[69] = "Wireless & Mobile";
arrItemsGrp2[69] = 7
arrItems2[58] = "Residential Access";
arrItemsGrp2[58] = 8
arrItems2[59] = "Wireless Networking";
arrItemsGrp2[59] = 8
arrItems2[60] = "Residential Gateway";
arrItemsGrp2[60] = 8
arrItems2[61] = "Wired Networking";
arrItemsGrp2[61] = 8
arrItems2[62] = "Customer Premises Equipment";
arrItemsGrp2[62] = 9
arrItems2[63] = "Broadcast Equipment";
arrItemsGrp2[63] = 9
arrItems2[64] = "Enabling Technologies";
arrItemsGrp2[64] = 9
arrItems2[65] = "Internet";
arrItemsGrp2[65] = 9
arrItems2[66] = "Mobile & PDA";
arrItemsGrp2[66] = 9
arrItems2[70] = "Infiniband";
arrItemsGrp2[70] = 10
arrItems2[71] = "Storage Sub-Systems";
arrItemsGrp2[71] = 10
arrItems2[72] = "System Area Network";
arrItemsGrp2[72] = 10
arrItems2[73] = "Systems & Hardware";
arrItemsGrp2[73] = 10
arrItems2[74] = "Storage Software";
arrItemsGrp2[74] = 10
arrItems2[85] = "Browser Add-Ons";
arrItemsGrp2[85] = 12
arrItems2[86] = "Stand-alone Software";
arrItemsGrp2[86] = 12
arrItems2[89] = "Media";
arrItemsGrp2[89] = 13
arrItems2[90] = "Content Management";
arrItemsGrp2[90] = 13
arrItems2[91] = "Industries";
arrItemsGrp2[91] = 13
arrItems2[87] = "Advertising";
arrItemsGrp2[87] = 14
arrItems2[88] = "Customer Relationship";
arrItemsGrp2[88] = 14
arrItems2[92] = "Cellular";
arrItemsGrp2[92] = 15
arrItems2[93] = "Messaging";
arrItemsGrp2[93] = 15
arrItems2[94] = "VOIP";
arrItemsGrp2[94] = 15
arrItems2[95] = "Billing";
arrItemsGrp2[95] = 16
arrItems2[96] = "Comparison Shopping";
arrItemsGrp2[96] = 16
arrItems2[97] = "Marketplace";
arrItemsGrp2[97] = 16
arrItems2[98] = "3D & Imaging";
arrItemsGrp2[98] = 16
arrItems2[108] = "Diagnosis";
arrItemsGrp2[108] = 17
arrItems2[109] = "Laboratory Tools";
arrItemsGrp2[109] = 17
arrItems2[110] = "Bio-Agro & Food Flavour";
arrItemsGrp2[110] = 17
arrItems2[111] = "Treatment";
arrItemsGrp2[111] = 17
arrItems2[112] = "Platforms for Drug Research";
arrItemsGrp2[112] = 17
arrItems2[113] = "Monitoring";
arrItemsGrp2[113] = 18
arrItems2[114] = "Imaging & Visualisation";
arrItemsGrp2[114] = 18
arrItems2[115] = "IT & Training";
arrItemsGrp2[115] = 18
arrItems2[116] = "Invasive Therapy";
arrItemsGrp2[116] = 18
arrItems2[117] = "Non-Invasive Therapy";
arrItemsGrp2[117] = 18
arrItems2[118] = "3D Modeling";
arrItemsGrp2[118] = 19
arrItems2[119] = "Printing Machines";
arrItemsGrp2[119] = 19
arrItems2[120] = "Fab Inspection";
arrItemsGrp2[120] = 20
arrItems2[121] = "Fab Process Enabling";
arrItemsGrp2[121] = 20
arrItems2[122] = "Fab Process Management";
arrItemsGrp2[122] = 20
arrItems2[123] = "Optical";
arrItemsGrp2[123] = 20
arrItems2[124] = "PCB";
arrItemsGrp2[124] = 20
arrItems2[125] = "Nano Materials";
arrItemsGrp2[125] = 23
arrItems2[126] = "Measurement & Inspection";
arrItemsGrp2[126] = 23
arrItems2[127] = "Humidity Management";
arrItemsGrp2[127] = 23
arrItems2[128] = "Power Management";
arrItemsGrp2[128] = 23
arrItems2[129] = "Other";
arrItemsGrp2[129] = 23
arrItems2[130] = "Screens";
arrItemsGrp2[130] = 24
arrItems2[131] = "Surveillance & Security";
arrItemsGrp2[131] = 24
arrItems2[132] = "Other";
arrItemsGrp2[132] = 24
function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--) controlToPopulate.options[q]=null;
if (control.name == "firstChoice") {
// Empty the third drop down box of any choices
for (var q=myChoices.thirdChoice.options.length;q>=0;q--) myChoices.thirdChoice.options[q] = null;
}
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>
</head>
<body>
<form name=myChoices>
<table align="center">
<tr>
<td>
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this, myChoices.secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Telecommunications</option>
<option value=2>Information Technology</option>
<option value=3>Components</option>
<option value=4>Internet</option>
<option value=5>Life Sciences</option>
<option value=6>Capital Equipment</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice onchange="selectChange(this, myChoices.thirdChoice, arrItems2, arrItemsGrp2);">
</SELECT>
<SELECT id=thirdChoice name=thirdChoice>
</SELECT>
</TD>
</TR>
</TABLE>
</form>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>
</body>
</html>