Código HTML:
<script language = "JavaScript"> var aa = new Array("Transfer"); var bb = new Array("Marketing"); Transfer = new Array ("Providers","Marketing"); Marketing = new Array ("Rayniel","Webmaster"); function changeval() { var val1 = document.sform.sel1.value; var optionArray = eval(val1); for(var df=0; df<optionArray.length; df++) { var ss = document.sform.sel2; ss.options.length = 0; for(var ff=0; ff<optionArray.length; ff++) { { var ss = document.sform.sel3; ss.options.length = 0; for(var ff=0; ff<optionArray.length; ff++) var val = optionArray[ff]; ss.options[ff] = new Option(val,val); } } } } </script> </head> <body> <form action="<?php echo $editFormAction; ?>" method="post" name="sform" id="sform"> Category: <select name="sel1" onchange="changeval()"> <option>Select Category</option> <script language="JavaScript" type="text/javascript"> for(var dd=0; dd<aa.length; dd++) { document.write("<option value=\""+aa[dd]+"\">"+aa[dd]+"</option>"); } </script> </select> Subcategory: <select name="sel2"> <option>Select Subcategory</option> <script language="JavaScript" type="text/javascript"> for(var dd=0; dd<aa.length; dd++) { document.write("<option value=\""+aa[dd]+"\">"+aa[dd]+"</option>"); } </script> </select> <!-- Aqui empieza mi prueba --> <select name="sel3"> <option>Select Subcategory</option> <script language="JavaScript" type="text/javascript"> for(var dd=0; dd<bb.length; dd++) { document.write("<option value=\""+bb[dd]+"\">"+bb[dd]+"</option>"); } </script> </select> <!-- Aqui termina mi prueba --> <input type="submit" name="Submit" value="Transfer" /> </form>