... in questo modo:
Da usare così:codice:<script language="JavaScript"> function Genera(indice) { indice=parseInt(indice); var s2=document.nomeform.selezione2; switch(indice) { case 0: s2.options[0]=new Option("Cucine","Cucine"); s2.options[1]=new Option("Salotti","Salotti"); s2.options[2]=new Option("Complementi","Complementi"); s2.length=3; break; case 1: s2.options[0]=new Option("Ingegneristica","Ingegneristica"); s2.options[1]=new Option("Meccanica1","Meccanica1"); s2.options[2]=new Option("Meccanica2","Meccanica2"); s2.length=3; break; } } </script>
<select name="selezione1" onChange="Genera(this.selectedIndex);">
<option value="arredamento">Arredamento</option>
<option value="meccanica">Meccanica</option>
</select>
<select name="selezione2">
</select>
Ciao !![]()

Rispondi quotando