Grazie KillerWorm per aver insistito per l'uso del validatore che, smemorato e pigro, non usavo. Con esso ho corretto tutti errori del codice in esame.
lanvoel
codice:<!doctype html> <html lang="it"> <head> <title>Prove tag select </title> <script> function spostaOpzioni(direzione) { var i=0; with (document.modulo) { if (direzione) { for(i=0; i<menu1.length; i++) { if(menu1.options[i].selected) { var opt=new Option(menu1.options[i].text); menu2.options.add(opt,menu2.length); menu1.options.remove(i); } } } else { for(i=0; i<menu2.length; i++) { if(menu2.options[i].selected) { var opt=new Option(menu2.options[i].text); menu1.options.add(opt,menu1.length); menu2.options.remove(i); } } } } } </script> </head> <body> <form name="modulo"> <table style="background:#fbceb1; border: 2px solid gray;"> <tr><td style="text-align:center;"> <select size="10" name="menu1" style="width:180px" ondblclick="spostaOpzioni(true)"> <option> Elemento 1</option> <option> Elemento 2_9876543210_9876543210</option> <option> Elemento 3</option> <option> Elemento 4</option> <option> Elemento 5</option> </select></td> <td style="text-align:center;"> <select size="10" name="menu2" style="width:180px" ondblclick="spostaOpzioni(false)"> <option> Elemento 6</option> </select></td> <tr><td style="text-align:center; width:200px;"> <input type="button" value=" >> " onclick="spostaOpzioni(true)"></td> <td style="text-align:center; width:200px;"> <input type="button" value=" << " onclick="spostaOpzioni(false)"></td> </tr> </table> </form> </body> </html>

Rispondi quotando

