Ciao delfina blu,
questa funzionalità di firefox non la sapevo.
Ho provato a farla per IE così
sia con IE che con FF prmendo sempre la stessa lettera si scorrono le options che iniziano con quell'iniziale... con questo script si perde questa funzionalità.codice:<script language="javascript"> if (document.layers){ window.captureEvents(Event.ONKEYDOWN); window.onkeydown=PrecompilaSelect; }else if (document.all) document.onkeydown=PrecompilaSelect; var testoselect = new Array var nomeselect = '' var ultimadigitazione = '' function PrecompilaSelect(e){ if(nomeselect!=''){ if(ultimadigitazione=='')ultimadigitazione=new Date() var adesso = new Date() var tempotrascorso = (adesso.getTime()-ultimadigitazione.getTime()) if(tempotrascorso>500)testoselect[nomeselect]='' ultimadigitazione=adesso var lettera=(event)?String.fromCharCode(event.keyCode):String.fromCharCode(e.keyCode) testoselect[nomeselect]+=lettera setTimeout('cerca(document.NomeForm.'+nomeselect+',"'+testoselect[nomeselect]+'")',100) } } function cerca(ss,inizio){ for(i=0;i<ss.options.length;i++){ if(ss.options[i].text.toLowerCase().substr(0,inizio.length)==inizio.toLowerCase()){ ss.options[i].selected=true i=ss.options.length } } } </script> <form name="NomeForm"> <select name="NomeSelect" onfocus="nomeselect=this.name;testoselect[nomeselect]=''" onblur="nomeselect='';"> <option>Alberta</option> <option>Alberto</option> <option>Antonello</option> <option>Antonio</option> <option>Francesco</option> <option>Franco</option> <option>Fulvio</option> </select> <select name="NomeSelect2" onfocus="nomeselect=this.name;testoselect[nomeselect]=''" onblur="nomeselect='';"> <option>1200</option> <option>1250</option> <option>1300</option> <option>1333</option> <option>1334</option> <option>1420</option> <option>1422</option> </select> </form>
![]()

Rispondi quotando