Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 14
  1. #1

    [IE] Ricerca in una select

    Ho un problema con IE.
    Nella mia pagina ho una select con circa 150 options.
    codice:
    <select>
       <option>ALBERO</option>
       <option>ANDROIDE</option>
       <option>ASTUCCIO</option>
       <option>DROMEDARIO</option>
       <option>NICODEMO</option>
    ...
    </select>
    Usando firefox succede che se io selezione con il mouse la select e poi con il la tastiera digito velocemente "and" il viene immediatamente evidenziata l'opzione 'ANDROIDE' mentre se eseguo la stessa operazione con IE prima viene selezionato 'Albero' poi 'Nicodemo e infine 'Dromedario'.

    Come si può ottenere in IE lo stesso effetto di firefox?

    Grazie
    Flickr .:. Work In Progress

    Non lasciare la mia mano, ovunque sarai, con chiunque ti accompagnerai. Non dimenticarti di me, ne morirei.

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    Dovresti chiedere a zio Bill se ti fa un browser su misura.

    Anche il comportamento di FF non e` standard; sono implementazioni comode, ma non puoi contarci (non in questo momento).

    Sono state fatte proposto per realizzare la cosa con JS: sono un po' complesse, e non ricordo se sono poi state completate. Fai una ricerca nel forum.
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

  3. #3
    Originariamente inviato da Mich_
    Dovresti chiedere a zio Bill se ti fa un browser su misura.

    Anche il comportamento di FF non e` standard; sono implementazioni comode, ma non puoi contarci (non in questo momento).

    Sono state fatte proposto per realizzare la cosa con JS: sono un po' complesse, e non ricordo se sono poi state completate. Fai una ricerca nel forum.
    Infatti se zio Bill si decidesse a sistemare la gestione delle select sarei più contenta senza fare un browser su misura (vedi select che buca i layers).

    Cmq ho fatto una ricerca nelle pillole e nelle discussioni utili ma non ho trovato nulla..provo a fare la ricera dai post più vecchi. Se nel frattempo ci sono link che qualcuno trova, posto pure!
    Flickr .:. Work In Progress

    Non lasciare la mia mano, ovunque sarai, con chiunque ti accompagnerai. Non dimenticarti di me, ne morirei.

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2001
    Messaggi
    21,188
    Ecco qui: postato poco prima di te la soluzione che cercavi (forse):
    http://forum.html.it/forum/showthrea...hreadid=800097
    Nuova politica di maggiore severita` sui titoli delle discussioni: (ri)leggete il regolamento
    No domande tecniche in messaggi privati

  5. #5
    Utente di HTML.it
    Registrato dal
    Jul 2003
    Messaggi
    667
    Forse questo potrebbe interessarti:

    codice:
    <HTML>
    <HEAD>
    	<TITLE>Selezione da una lista digitando i caratteri in un TextBox</TITLE>
    <HEAD>
    <SCRIPT>
    <!--
    function Cerca()
    	{
    	with (document.modulo)
    		{
    		ThisFind=-1;
    		StringToSearch=input.value;
    		StringToSearchLength=StringToSearch.length;
    		if (StringToSearchLength>0)
    			for (i=0;i<stati.options.length;i++)
    				ThisFind==-1&&stati.options[i].text.toLowerCase().substring(0,StringToSearchLength)==StringToSearch?ThisFind=i:null;
    		else
    			ThisFind=0;
    
    		stati.selectedIndex=ThisFind;
    		} 
    	}
    //-->
    </SCRIPT>
    </HEAD>
    <BODY BGCOLOR="#ffffff">
    <FORM NAME="modulo">
    <INPUT TYPE="text" NAME="input" VALUE="Scrivi..." CLASS="" onKeyUp="this.value=this.value.toLowerCase();Cerca()" onFocus="this.select()"> 
    
    <SELECT NAME="stati" size="5">
    <OPTION>Albania</OPTION>
    <OPTION>Algeria</OPTION>
    <OPTION>American Samoa</OPTION>
    <OPTION>Andorra</OPTION>
    <OPTION>Angola</OPTION>
    <OPTION>Anguilla</OPTION>
    <OPTION>Antarctica</OPTION>
    <OPTION>Antigua and Barbuda</OPTION>
    <OPTION>Argentina</OPTION>
    <OPTION>Armenia</OPTION>
    <OPTION>Aruba</OPTION>
    <OPTION>Australia</OPTION>
    <OPTION>Austria</OPTION>
    <OPTION>Azerbaidjan</OPTION>
    <OPTION>Bahamas</OPTION>
    <OPTION>Bahrain</OPTION>
    <OPTION>Banglades</OPTION>
    <OPTION>Barbados</OPTION>
    <OPTION>Belarus</OPTION>
    <OPTION>Belgium</OPTION>
    <OPTION>Belize</OPTION>
    <OPTION>Benin</OPTION>
    <OPTION>Bermuda</OPTION>
    <OPTION>Bolivia</OPTION>
    <OPTION>Bosnia-Herzegovina</OPTION>
    <OPTION>Botswana</OPTION>
    <OPTION>Bouvet Island</OPTION>
    <OPTION>Brazil</OPTION>
    <OPTION>British Indian O. Terr.</OPTION>
    <OPTION>Brunei Darussalam</OPTION>
    <OPTION>Bulgaria</OPTION>
    <OPTION>Burkina Faso</OPTION>
    <OPTION>Burundi</OPTION>
    <OPTION>Buthan</OPTION>
    <OPTION>Cambodia</OPTION>
    <OPTION>Cameroon</OPTION>
    <OPTION>Canada</OPTION>
    <OPTION>Cape Verde</OPTION>
    <OPTION>Cayman Islands</OPTION>
    <OPTION>Central African Rep.</OPTION>
    <OPTION>Chad</OPTION>
    <OPTION>Chile</OPTION>
    <OPTION>China</OPTION>
    <OPTION>Christmas Island</OPTION>
    <OPTION>Cocos (Keeling) Isl.</OPTION>
    <OPTION>Colombia</OPTION>
    <OPTION>Comoros</OPTION>
    <OPTION>Congo</OPTION>
    <OPTION>Cook Islands</OPTION>
    <OPTION>Costa Rica</OPTION>
    <OPTION>Croatia</OPTION>
    <OPTION>Cuba</OPTION>
    <OPTION>Cyprus</OPTION>
    <OPTION>Czech Republic</OPTION>
    <OPTION>Czechoslovakia</OPTION>
    <OPTION>Denmark</OPTION>
    <OPTION>Djibouti</OPTION>
    <OPTION>Dominica</OPTION>
    <OPTION>Dominican Republic</OPTION>
    <OPTION>East Timor</OPTION>
    <OPTION>Ecuador</OPTION>
    <OPTION>Egypt</OPTION>
    <OPTION>El Salvador</OPTION>
    <OPTION>Equatorial Guinea</OPTION>
    <OPTION>Estonia</OPTION>
    <OPTION>Ethiopia</OPTION>
    <OPTION>Falkland Isl.(Malvinas)</OPTION>
    <OPTION>Faroe Islands</OPTION>
    <OPTION>Fiji</OPTION>
    <OPTION>Finland</OPTION>
    <OPTION>France</OPTION>
    <OPTION>France (European Ter.)</OPTION>
    <OPTION>French Southern Terr.</OPTION>
    <OPTION>Gabon</OPTION>
    <OPTION>Gambia</OPTION>
    <OPTION>Georgia</OPTION>
    <OPTION>Germany</OPTION>
    <OPTION>Ghana</OPTION>
    <OPTION>Gibraltar</OPTION>
    <OPTION>Great Britain (UK)</OPTION>
    <OPTION>Greece</OPTION>
    <OPTION>Greenland</OPTION>
    <OPTION>Grenada</OPTION>
    <OPTION>Guadeloupe (Fr.)</OPTION>
    <OPTION>Guam (US)</OPTION>
    <OPTION>Guatemala</OPTION>
    <OPTION>Guinea</OPTION>
    <OPTION>Guinea Bissau</OPTION>
    <OPTION>Guyana</OPTION>
    <OPTION>Guyana (Fr.)</OPTION>
    <OPTION>Haiti</OPTION>
    <OPTION>Heard & McDonald Isl.</OPTION>
    <OPTION>Honduras</OPTION>
    <OPTION>Hong Kong</OPTION>
    <OPTION>Hungary</OPTION>
    <OPTION>Iceland</OPTION>
    <OPTION>India</OPTION>
    <OPTION>Indonesia</OPTION>
    <OPTION>Iran</OPTION>
    <OPTION>Iraq</OPTION>
    <OPTION>Ireland</OPTION>
    <OPTION>Israel</OPTION>
    <OPTION>Italy</OPTION>
    <OPTION>Ivory Coast</OPTION>
    <OPTION>Jamaica</OPTION>
    <OPTION>Japan</OPTION>
    <OPTION>Jordan</OPTION>
    <OPTION>Kazachstan</OPTION>
    <OPTION>Kenya</OPTION>
    <OPTION>Kirgistan</OPTION>
    <OPTION>Kiribati</OPTION>
    <OPTION>Korea (North)</OPTION>
    <OPTION>Korea (South)</OPTION>
    <OPTION>Kuwait</OPTION>
    <OPTION>Laos</OPTION>
    <OPTION>Latvia</OPTION>
    <OPTION>Lebanon</OPTION>
    <OPTION>Lesotho</OPTION>
    <OPTION>Liberia</OPTION>
    <OPTION>Libya</OPTION>
    <OPTION>Liechtenstein</OPTION>
    <OPTION>Lithuania</OPTION>
    <OPTION>Luxembourg</OPTION>
    <OPTION>Macau</OPTION>
    <OPTION>Madagascar</OPTION>
    <OPTION>Malawi</OPTION>
    <OPTION>Malaysia</OPTION>
    <OPTION>Maldives</OPTION>
    <OPTION>Mali</OPTION>
    <OPTION>Malta</OPTION>
    <OPTION>Marshall Islands</OPTION>
    <OPTION>Martinique (Fr.)</OPTION>
    <OPTION>Mauritania</OPTION>
    <OPTION>Mauritius</OPTION>
    <OPTION>Mexico</OPTION>
    <OPTION>Micronesia</OPTION>
    <OPTION>Moldavia</OPTION>
    <OPTION>Monaco</OPTION>
    <OPTION>Mongolia</OPTION>
    <OPTION>Montserrat</OPTION>
    <OPTION>Morocco</OPTION>
    <OPTION>Mozambique</OPTION>
    <OPTION>Myanmar</OPTION>
    <OPTION>Namibia</OPTION>
    <OPTION>Nauru</OPTION>
    <OPTION>Nepal</OPTION>
    <OPTION>Netherland Antilles</OPTION>
    <OPTION>Netherlands</OPTION>
    <OPTION>Neutral Zone</OPTION>
    <OPTION>New Caledonia (Fr.)</OPTION>
    <OPTION>New Zealand</OPTION>
    <OPTION>Nicaragua</OPTION>
    <OPTION>Niger</OPTION>
    <OPTION>Nigeria</OPTION>
    <OPTION>Niue</OPTION>
    <OPTION>Norfolk Island</OPTION>
    <OPTION>Northern Mariana Isl.</OPTION>
    <OPTION>Norway</OPTION>
    <OPTION>Oman</OPTION>
    <OPTION>Pakistan</OPTION>
    <OPTION>Palau</OPTION>
    <OPTION>Panama</OPTION>
    <OPTION>Papua New</OPTION>
    <OPTION>Paraguay</OPTION>
    <OPTION>Peru</OPTION>
    <OPTION>Philippines</OPTION>
    <OPTION>Pitcairn</OPTION>
    <OPTION>Poland</OPTION>
    <OPTION>Polynesia (Fr.)</OPTION>
    <OPTION>Portugal</OPTION>
    <OPTION>Puerto Rico (US)</OPTION>
    <OPTION>Qatar</OPTION>
    <OPTION>Reunion (Fr.)</OPTION>
    <OPTION>Romania</OPTION>
    <OPTION>Russian Federation</OPTION>
    <OPTION>Rwanda</OPTION>
    <OPTION>Saint Lucia</OPTION>
    <OPTION>Samoa</OPTION>
    <OPTION>San Marino</OPTION>
    <OPTION>Saudi Arabia</OPTION>
    <OPTION>Senegal</OPTION>
    <OPTION>Seychelles</OPTION>
    <OPTION>Sierra Leone</OPTION>
    <OPTION>Singapore</OPTION>
    <OPTION>Slovak Republic</OPTION>
    <OPTION>Slovenia</OPTION>
    <OPTION>Solomon Islands</OPTION>
    <OPTION>Somalia</OPTION>
    <OPTION>South Africa</OPTION>
    <OPTION>Soviet Union</OPTION>
    <OPTION>Spain</OPTION>
    <OPTION>Sri Lanka</OPTION>
    <OPTION>St. Helena</OPTION>
    <OPTION>St. Pierre & Miquelon</OPTION>
    <OPTION>St. Tome and Principe</OPTION>
    <OPTION>St.Kitts Nevis Anguilla</OPTION>
    <OPTION>St.Vincent & Grenadines</OPTION>
    <OPTION>Sudan</OPTION>
    <OPTION>Suriname</OPTION>
    <OPTION>Svalbard & Jan Mayen Is</OPTION>
    <OPTION>Swaziland</OPTION>
    <OPTION>Sweden</OPTION>
    <OPTION>Switzerland</OPTION>
    <OPTION>Syria</OPTION>
    <OPTION>Tadjikistan</OPTION>
    <OPTION>Taiwan</OPTION>
    <OPTION>Tanzania</OPTION>
    <OPTION>Thailand</OPTION>
    <OPTION>Togo</OPTION>
    <OPTION>Tokelau</OPTION>
    <OPTION>Tonga</OPTION>
    <OPTION>Trinidad & Tobago</OPTION>
    <OPTION>Tunisia</OPTION>
    <OPTION>Turkey</OPTION>
    <OPTION>Turkmenistan</OPTION>
    <OPTION>Turks & Caicos Islands</OPTION>
    <OPTION>Tuvalu</OPTION>
    <OPTION>US Minor outlying Isl.</OPTION>
    <OPTION>Uganda</OPTION>
    <OPTION>Ukraine</OPTION>
    <OPTION>United Arab Emirates</OPTION>
    <OPTION>United Kingdom</OPTION>
    <OPTION>United States</OPTION>
    <OPTION>Uruguay</OPTION>
    <OPTION>Uzbekistan</OPTION>
    <OPTION>Vanuatu</OPTION>
    <OPTION>Vatican City State</OPTION>
    <OPTION>Venezuela</OPTION>
    <OPTION>Vietnam</OPTION>
    <OPTION>Virgin Islands (British)</OPTION>
    <OPTION>Virgin Islands (US)</OPTION>
    <OPTION>Wallis & Futuna Islands</OPTION>
    <OPTION>Western Sahara</OPTION>
    <OPTION>Yemen</OPTION>
    <OPTION>Yugoslavia</OPTION>
    <OPTION>Zaire</OPTION>
    <OPTION>Zambia</OPTION>
    <OPTION>Zimbabwe</OPTION>
    </SELECT>
    </FORM>
    </BODY>
    </HTML>

  6. #6
    Originariamente inviato da mrcanoa
    Forse questo potrebbe interessarti:
    ...
    il ragionamento è giusto, ma non lo posso applicare in questo modo. io devo ottimizzare i seguenti filtri ma che già occupano troppo spazio.
    sfortunatamente questo tipo di ricerca che mi necessita lo fa firefox di defaul ma non IE




    non posso usare la solutione che mi si propone sulla select bondtype
    Flickr .:. Work In Progress

    Non lasciare la mia mano, ovunque sarai, con chiunque ti accompagnerai. Non dimenticarti di me, ne morirei.

  7. #7
    Utente di HTML.it L'avatar di willybit
    Registrato dal
    May 2001
    Messaggi
    4,367
    Ciao delfina blu,

    questa funzionalità di firefox non la sapevo.
    Ho provato a farla per IE così
    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>
    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à.

  8. #8
    Caro willybit, ci siamo! la funzionalità non viene persa cioè se digito sempre la A le option scorrono, inoltre se digito velocemente l'intera parola mi si posiziona esattamente dove voglio io.
    Grasssie
    Flickr .:. Work In Progress

    Non lasciare la mia mano, ovunque sarai, con chiunque ti accompagnerai. Non dimenticarti di me, ne morirei.

  9. #9
    Utente di HTML.it L'avatar di willybit
    Registrato dal
    May 2001
    Messaggi
    4,367
    anvedi... è vero... non funziona perfettamente ma funziona

  10. #10
    si bisogna scrivere molto velocemente ed è l'unico problema per un utente normale che scrive con i due incidi. Ma per il resto è abbastanza performante. Potrebbe essere una pillolina, c'era diversa gente che cercava una cosa del genere.
    Flickr .:. Work In Progress

    Non lasciare la mia mano, ovunque sarai, con chiunque ti accompagnerai. Non dimenticarti di me, ne morirei.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.