Hello,
I came across the following script that has two dropdown boxes the category and subcategory. Works great, but if I try to copy the code to add more boxes the <noscript> part hides everything and only shows the first two boxes (category and subcategory) is there a way around this?
I came across the following script that has two dropdown boxes the category and subcategory. Works great, but if I try to copy the code to add more boxes the <noscript> part hides everything and only shows the first two boxes (category and subcategory) is there a way around this?
Code:
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="javascript" type="text/javascript">
function dropdownlist(listindex)
{
document.formname.subcategory.options.length = 0;
switch (listindex)
{
case "Missing" :
document.formname.subcategory.options[0]=new Option("Select Sub-Category","");
document.formname.subcategory.options[1]=new Option("Set Screws","Set Screws");
document.formname.subcategory.options[2]=new Option("Operations","Operations");
break;
case "Surface" :
document.formname.subcategory.options[0]=new Option("Select Sub-Category","");
document.formname.subcategory.options[1]=new Option("Finish","Finish");
document.formname.subcategory.options[2]=new Option("Blemished","Blemished");
document.formname.subcategory.options[3]=new Option("Chipped","Chipped");
document.formname.subcategory.options[4]=new Option("Color","Color");
break;
case "Flash" :
document.formname.subcategory.options[0]=new Option("Select Sub-Category","");
document.formname.subcategory.options[1]=new Option("In Thread","In Thread");
document.formname.subcategory.options[2]=new Option("On Part","On Part");
break;
case "Insert" :
document.formname.subcategory.options[0]=new Option("Select Sub-Category","");
document.formname.subcategory.options[1]=new Option("Wrong Thread","Wrong Thread");
document.formname.subcategory.options[2]=new Option("Tight Thread","Tight Thread");
document.formname.subcategory.options[3]=new Option("Loose Thread","Loose Thread");
break;
case "Defective" :
document.formname.subcategory.options[0]=new Option("Select Sub-Category","");
document.formname.subcategory.options[1]=new Option("Cracked","Cracked");
document.formname.subcategory.options[2]=new Option("Undercured","Undercured");
document.formname.subcategory.options[3]=new Option("Scratches","Scratches");
document.formname.subcategory.options[4]=new Option("Incorrect Dimensions","Incorrect Dimensions");
break;
case "Shipping" :
document.formname.subcategory.options[0]=new Option("Select Sub-Category","");
document.formname.subcategory.options[1]=new Option("Shortage","Shortage");
document.formname.subcategory.options[2]=new Option("Overshipment","Overshipment");
document.formname.subcategory.options[3]=new Option("Wrong Parts","Wrong Parts");
document.formname.subcategory.options[4]=new Option("Mixed Parts","Mixed Parts");
document.formname.subcategory.options[5]=new Option("Damaged By Carrier","Damaged By Carrier");
break;
case "Return For Rework" :
document.formname.subcategory.options[0]=new Option("","");
break;
case "Pricing Error" :
document.formname.subcategory.options[0]=new Option("","");
break;
}
return true;
}
</script>
</head>
<title>Dynamic Drop Down List</title>
<body>
<form id="formname" name="formname" method="post" action="submitform.asp" >
<table width="50%" border="0" cellspacing="0" cellpadding="5">
<tr>
<td width="20%" align="right" valign="middle">Category :</td>
<td width="27%" rowspan="3" align="left" valign="middle"><select name="codenumcomplaint1" id="codenumcomplaint1" onchange="javascript: dropdownlist(this.options[this.selectedIndex].value);">
<option value="">Select Category</option>
<option value="Defective">Defective</option>
<option value="Flash">Flash</option>
<option value="Insert">Insert</option>
<option value="Missing">Missing</option>
<option value="Pricing Error">Pricing Error</option>
<option value="Return For Rework">Return For Rework</option>
<option value="Shipping">Shipping</option>
<option value="Surface">Surface</option>
</select></td><td width="53%" rowspan="3" align="left" valign="middle"><p>
<script type="text/javascript" language="JavaScript">
document.write('<select name="subcategory"><option value="">Select Sub-Category</option></select>')
</script>
<noscript>
<select name="subcategory" id="subcategory" >
<option value="">Select Sub-Category</option>
</select>
</p>