IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP.NET Discussion :

[VB.Net] Comment faire pour simuler l'autocomplete sur un DropDownList ?


Sujet :

ASP.NET

  1. #1
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut [VB.Net] Comment faire pour simuler l'autocomplete sur un DropDownList ?
    Bonjour,

    J'aimerais que l'utilisateur de mon interface aspx soit capable de choisir un élément de ma dropdownlist en tappant les premières lettres.

    Exemple : J'ai "chat", "écureuille", "hibou" ...

    Je voudrais qu'en tappant "c" et "h" il soit sélectionné chat au lieu de hibou. (parce que présentement, c'est seulement la première lettre qui influence la sélection)

    J'ai fait quelques recherche et j'ai vu que sur certains contrôle il y avait la propriété autocomplete, mais celà n'existe pas avec un dropdownlist.

    Quelqu'un peu m'aider svp?

    Merci à l'avance!

  2. #2
    Membre habitué

    Inscrit en
    Juin 2005
    Messages
    142
    Détails du profil
    Informations forums :
    Inscription : Juin 2005
    Messages : 142
    Points : 174
    Points
    174
    Par défaut
    regarde sur atlas.asp.net

  3. #3
    Membre actif Avatar de neuropathie
    Inscrit en
    Janvier 2005
    Messages
    223
    Détails du profil
    Informations forums :
    Inscription : Janvier 2005
    Messages : 223
    Points : 201
    Points
    201
    Par défaut
    ce que j'utilise moi pour les combox box marche très bien, ci joint le code

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
     
    Private Sub combobox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles combobox.KeyPress
            If Char.IsControl(e.KeyChar) Then Return
            With Me.cmbFamilies
                Dim ToFind As String = .Text.Substring(0, .SelectionStart) '& e.KeyChar
                Dim Index As Integer = .FindStringExact(ToFind)
                If Index = -1 Then Index = .FindString(ToFind)
                If Index = -1 Then Return
                .SelectedIndex = Index
                .SelectionStart = ToFind.Length
                .SelectionLength = .Text.Length - .SelectionStart
                e.Handled = True
            End With
        End Sub

  4. #4
    Membre expert
    Avatar de FremyCompany
    Profil pro
    Étudiant
    Inscrit en
    Février 2006
    Messages
    2 532
    Détails du profil
    Informations personnelles :
    Âge : 32
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2006
    Messages : 2 532
    Points : 3 239
    Points
    3 239
    Par défaut
    Atlas, en effet... Atlas = AJAX + Service web.
    Très efficace.
    Fremy
    Pour vos développements Web et une navigation agréable, le tout gratuit :
    1) IE 8 + IE7Pro (Si vous ne connaissez pas IE7Pro, essayez !)
    2) FF 3 + Web Developper Toolbar + AdBlockPlus + FireBug + GreaseMonkey

  5. #5
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    Merci slyer je vais regarder ça.
    ***

    neuropathie,
    Est-ce que un combobox est la même chose qu'une dropdownlist? parce que je n'ai pas l'event keypress. Je n'ai pas non plus de contrôle qui se nomme combobox dans mon menu d'outil. (J'utilise VB.NET 2003)

  6. #6
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    Quelqu'un utilise Atlas?

    J'aimerais avoir des commentaires sur ce framework avant de l'installer. Je veux être sur que ça valle la peine. Et est-ce compatible avec vb.net 2003? Car ils parlent du 2005...

    Merci

  7. #7
    Membre expert
    Avatar de FremyCompany
    Profil pro
    Étudiant
    Inscrit en
    Février 2006
    Messages
    2 532
    Détails du profil
    Informations personnelles :
    Âge : 32
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2006
    Messages : 2 532
    Points : 3 239
    Points
    3 239
    Par défaut
    pour utiliser l'évent onkeypress (JS) tu dois OBLIGATOIREMENT passer par la balise. Il te dira que la propriété n'existe pas mais en fait, il la rajoutera on controle HTML.

    Je ne sais pas si AJAX est compatible 2003.
    Fremy
    Pour vos développements Web et une navigation agréable, le tout gratuit :
    1) IE 8 + IE7Pro (Si vous ne connaissez pas IE7Pro, essayez !)
    2) FF 3 + Web Developper Toolbar + AdBlockPlus + FireBug + GreaseMonkey

  8. #8
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    Pour ce qui est des tests que j'ai effectué avec Atlas et vb.net 2003, c'est pas très concluent...

    Je vais plutot regarder vers le javaScript.

  9. #9
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    J'ai trouvé quelque chose sur Internet qui fonctionne pour les lists d'item sans accents dans la dropdownlist. Il faut juste que je modifie le tout pour que ça prennent les accents en compte. J'ai arrangé le bout des entrées de lettre (onkeypress) il reste juste à vérifier si le nom de la liste contiens des accents et à les traiter sans accents. Mais j'ai aucune idée comment faire...

    Quelqu'un peut m'aider?

    Voici le code :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
     
    var toFind = ""; // Variable that acts as keyboard buffer
    var timeoutID = ""; // Process id for timer (used when stopping
    // the timeout)
    timeoutInterval = 250; // Milliseconds. Shorten to cause keyboard
    // buffer to be cleared faster
    var timeoutCtr = 0; // Initialization of timer count down
    var timeoutCtrLimit = 3 ; // Number of times to allow timer to count
    // down
    var oControl = ""; // Maintains a global reference to the
    // control that the user is working with.
     
    function listbox_onkeypress(){
     
    	// This function is called when the user presses a key while focus is in
    	// the listbox. It maintains the keyboard buffer.
    	// Each time the user presses a key, the timer is restarted.
    	// First, stop the previous timer; this function will restart it.
    	window.clearInterval(timeoutID)
     
    	// Which control raised the event? We'll need to know which control to
    	// set the selection in.
    	oControl = window.event.srcElement;
     
    	var keycode = window.event.keyCode;
    	if(keycode >= 32 ){
    		//What character did the user type?
    		//alert("Vous avez tapé : " + keycode);
    		if (keycode==101 || keycode==200 || keycode==201 || keycode==202 || keycode==232 || keycode==233 || keycode=234 ){
                          keycode=69;} //############test à moi pour les accents...############
    		var c = String.fromCharCode(keycode);
    		c = c.toUpperCase();
    		// Convert it to uppercase so that comparisons don't fail
    		toFind += c ; // Add to the keyboard buffer
    		find(); // Search the listbox
    		timeoutID = window.setInterval("idle()", timeoutInterval);
    		// Restart the timer
    	}
    }
     
    function listbox_onblur(){
    	// This function is called when the user leaves the listbox.
     
    	window.clearInterval(timeoutID);
    	resetToFind();
    }
     
    function idle(){
    	// This function is called if the timeout expires. If this is the
    	// third (by default) time that the idle function has been called,
    	// it stops the timer and clears the keyboard buffer
     
    	timeoutCtr += 1
    	if(timeoutCtr > timeoutCtrLimit){
    		resetToFind();
    		timeoutCtr = 0;
    		window.clearInterval(timeoutID);
    	}
    }
     
    function resetToFind(){
    	toFind = ""
    }
     
     
    function find(){
    	// Walk through the select list looking for a match
     
    	var allOptions = document.all.item(oControl.id);
     
    	for (i=0; i < allOptions.length; i++){
    		// Gets the next item from the listbox
    		nextOptionText = allOptions(i).text.toUpperCase();
     
    		// By default, the values in the listbox and as entered by the
    		// user are strings. This causes a string comparison to be made,
    		// which is not correct for numbers (1 < 11 < 2).
    		// The following lines coerce numbers into an (internal) number
    		// format so that the subsequent comparison is done as a
    		// number (1 < 2 < 11).
     
    		if(!isNaN(nextOptionText) && !isNaN(toFind) ){
    			nextOptionText *= 1; // coerce into number
    			toFind *= 1;
    		}
     
    		// Does the next item match exactly what the user typed?
    		if(toFind == nextOptionText){
    			// OK, we can stop at this option. Set focus here
    			oControl.selectedIndex = i;
    			window.event.returnValue = false;
    			break;
    		}
     
    		// If the string does not match exactly, find which two entries
    		// it should be between.
    		if(i < allOptions.length-1){
     
    			// If we are not yet at the last listbox item, see if the
    			// search string comes between the current entry and the next
    			// one. If so, place the selection there.
     
    			lookAheadOptionText = allOptions(i+1).text.toUpperCase() ;
    			if( (toFind > nextOptionText) &&
    			(toFind < lookAheadOptionText) ){
    				oControl.selectedIndex = i+1;
    				window.event.cancelBubble = true;
    			window.event.returnValue = false;
    			break;
    			} // if
    		} // if
     
    		else{
     
    			// If we are at the end of the entries and the search string
    			// is still higher than the entries, select the last entry
     
    			if(toFind > nextOptionText){
    				oControl.selectedIndex = allOptions.length-1 // stick it
    				// at the end
    				window.event.cancelBubble = true;
    				window.event.returnValue = false;
    				break;
    			} // if
    		} // else
    	} // for
    } // function

  10. #10
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    Quelqu'un connais une fonction qui sert à retirer les accents d'un string???

  11. #11
    Membre expert
    Avatar de FremyCompany
    Profil pro
    Étudiant
    Inscrit en
    Février 2006
    Messages
    2 532
    Détails du profil
    Informations personnelles :
    Âge : 32
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2006
    Messages : 2 532
    Points : 3 239
    Points
    3 239
    Par défaut
    ==> Forum JS...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    string.replace(new RegExp("é","gi"),"e");
    Fremy
    Pour vos développements Web et une navigation agréable, le tout gratuit :
    1) IE 8 + IE7Pro (Si vous ne connaissez pas IE7Pro, essayez !)
    2) FF 3 + Web Developper Toolbar + AdBlockPlus + FireBug + GreaseMonkey

  12. #12
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    Oups... Dsl que ça ai changé de langage de programmation entre temps...

    Est-ce qu'il y a moyen de mettre la partie sur javascript sous le bon topic?

  13. #13
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    Problème résolu!

    J'ai ajouter ceci :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    string = string.replace(String.fromCharCode(201), "E");
    Pour chaque accent que je veux remplacer. c'est pas très chic, mais ça fonctionne.

    Tout ça pour régler un dropdownlist...

  14. #14
    Membre expert
    Avatar de FremyCompany
    Profil pro
    Étudiant
    Inscrit en
    Février 2006
    Messages
    2 532
    Détails du profil
    Informations personnelles :
    Âge : 32
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2006
    Messages : 2 532
    Points : 3 239
    Points
    3 239
    Par défaut
    Citation Envoyé par Taore
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    string = string.replace(String.fromCharCode(201), "E");
    Je ne veux pas te contrarier mais ca ne marchera pas toujours ton truc... "télé" deviendra "telé"...
    En JS, pour faire un remplacement de masse, tu dois passer par une RegExp...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    string = string.replace(new RegExp(String.fromCharCode(201), "gi"), "E");
    Le "gi" signifie :
    1/ g = autant de fois que l'expression peut être trouvée;
    2/ i = quelque soit la casse de l'expression (ex = e ou E);
    Fremy
    Pour vos développements Web et une navigation agréable, le tout gratuit :
    1) IE 8 + IE7Pro (Si vous ne connaissez pas IE7Pro, essayez !)
    2) FF 3 + Web Developper Toolbar + AdBlockPlus + FireBug + GreaseMonkey

  15. #15
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    C'est vrai merci, j'avais pas remarqué.

    Donc je résume ce qui a fonctionné :

    J'ai fait un js avec le code que j'ai donné plus haut, modifié un peu pour effacer les accents des string à traiter avec ce que FremyCompagny a donné.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    string = string.replace(new RegExp(String.fromCharCode(201), "gi"), "E"); 
    //Ça c'est pour "É" seulement, j'ai ajouté les autres que j'avais besoin.
    Ensuite, j'ai inséré le script dans ma page aspx avec :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <script src="monJavaScript.js" type="text/javascript"></script>
    et j'ai ajouté cette propriété dans la balise de ma dropdownlist :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    onkeypress="listbox_onkeypress()"
    Ça me sort une erreur en l'écrivant, mais ça passe à la compilation.

  16. #16
    Membre expert
    Avatar de FremyCompany
    Profil pro
    Étudiant
    Inscrit en
    Février 2006
    Messages
    2 532
    Détails du profil
    Informations personnelles :
    Âge : 32
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2006
    Messages : 2 532
    Points : 3 239
    Points
    3 239
    Par défaut
    Attention, cependant, car l'ID client et l'ID serveur sont différents...
    sur un ctrl, tu as deux property : ID == serveur & ClientID == client.
    Tu peux bien sur les utiliser, mais c'est pas pratique (tu dois génerer un script JS depuis ASP .Net).
    Sinon, change ta fonction en function MyName (dropdownlist) {}
    et remplace le onkeypress par "MyName(this)"
    Fremy
    Pour vos développements Web et une navigation agréable, le tout gratuit :
    1) IE 8 + IE7Pro (Si vous ne connaissez pas IE7Pro, essayez !)
    2) FF 3 + Web Developper Toolbar + AdBlockPlus + FireBug + GreaseMonkey

  17. #17
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    Je ne vois pas où je me sert de l'id serveur et client...

    Et puis je crois que je n'ai pas vraiment le choix de me générer un js dans mon projet asp.net car j'ai besoin de cette fonctionnalité dans plusieurs pages. Donc, je l'importe dans les pages que j'ai besoin.

    Si ta manière de faire est plus efficace que la mienne, peux-tu m'expliquer plus svp? Je ne voix pas où tu veux en venir...

    J'aimerais bien l'apprendre.

  18. #18
    Membre expert
    Avatar de FremyCompany
    Profil pro
    Étudiant
    Inscrit en
    Février 2006
    Messages
    2 532
    Détails du profil
    Informations personnelles :
    Âge : 32
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2006
    Messages : 2 532
    Points : 3 239
    Points
    3 239
    Par défaut
    pour récuperer le controle qui a exécuté l'event, ton script utilise
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    oControl = window.event.srcElement;
    Je veux bien, mais je suis sur qu'il y a des masses de navigateurs qui ne possèdent pas window.event.
    Deplus, si un autre onkeypress intervenait avant que la ligne ne soit exécutée, elle renverrait un mauvais controle HTML...
    je te propose donc de faire
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <asp:DropDownList onkeypress="listbox_onkeypress(this)" blablabla></asp:DropDownList>
    En effet, le this reverra le controle html qui a généré l'event dans TOUS les navigateurs
    Voci alors le nouveau visage de ta fonction :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    var toFind = ""; // Variable that acts as keyboard buffer
    var timeoutID = ""; // Process id for timer (used when stopping
    // the timeout)
    timeoutInterval = 250; // Milliseconds. Shorten to cause keyboard
    // buffer to be cleared faster
    var timeoutCtr = 0; // Initialization of timer count down
    var timeoutCtrLimit = 3 ; // Number of times to allow timer to count
    // down
    var oControl = ""; // Maintains a global reference to the
    // control that the user is working with.
    
    function listbox_onkeypress(ctrl){
    
    	// This function is called when the user presses a key while focus is in
    	// the listbox. It maintains the keyboard buffer.
    	// Each time the user presses a key, the timer is restarted.
    	// First, stop the previous timer; this function will restart it.
    	window.clearInterval(timeoutID)
    	
    	// Which control raised the event? We'll need to know which control to
    	// set the selection in. 
                 // Si ctrl est valide (non nul, non undefined, on l'utilise. Sinon, on essaie window.event
    	oControl = (ctrl != null || typeof (ctrl) != "undefined") ? ctrl : window.event.srcElement;
    	
    	var keycode = window.event.keyCode;
    	if(keycode >= 32 ){
    		//What character did the user type?
    		//alert("Vous avez tapé : " + keycode);
    		if (keycode==101 || keycode==200 || keycode==201 || keycode==202 || keycode==232 || keycode==233 || keycode=234 ){
                          keycode=69;} //############test à moi pour les accents...############
    		var c = String.fromCharCode(keycode);
    		c = c.toUpperCase();
    		// Convert it to uppercase so that comparisons don't fail
    		toFind += c ; // Add to the keyboard buffer
    		find(); // Search the listbox
    		timeoutID = window.setInterval("idle()", timeoutInterval);
    		// Restart the timer
    	}
    }
    
    function listbox_onblur(){
    	// This function is called when the user leaves the listbox.
    
    	window.clearInterval(timeoutID);
    	resetToFind();
    }
    
    function idle(){
    	// This function is called if the timeout expires. If this is the
    	// third (by default) time that the idle function has been called,
    	// it stops the timer and clears the keyboard buffer
    	
    	timeoutCtr += 1
    	if(timeoutCtr > timeoutCtrLimit){
    		resetToFind();
    		timeoutCtr = 0;
    		window.clearInterval(timeoutID);
    	}
    }
    
    function resetToFind(){
    	toFind = ""
    }
    
    
    function find(){
    	// Walk through the select list looking for a match
    	
    	var allOptions = document.all.item(oControl.id);
    	
    	for (i=0; i < allOptions.length; i++){
    		// Gets the next item from the listbox
    		nextOptionText = allOptions(i).text.toUpperCase();
    	
    		// By default, the values in the listbox and as entered by the
    		// user are strings. This causes a string comparison to be made,
    		// which is not correct for numbers (1 < 11 < 2).
    		// The following lines coerce numbers into an (internal) number
    		// format so that the subsequent comparison is done as a
    		// number (1 < 2 < 11).
    	
    		if(!isNaN(nextOptionText) && !isNaN(toFind) ){
    			nextOptionText *= 1; // coerce into number
    			toFind *= 1;
    		}
    
    		// Does the next item match exactly what the user typed?
    		if(toFind == nextOptionText){
    			// OK, we can stop at this option. Set focus here
    			oControl.selectedIndex = i;
    			window.event.returnValue = false;
    			break;
    		}
    	
    		// If the string does not match exactly, find which two entries
    		// it should be between.
    		if(i < allOptions.length-1){
    	
    			// If we are not yet at the last listbox item, see if the
    			// search string comes between the current entry and the next
    			// one. If so, place the selection there.
    	
    			lookAheadOptionText = allOptions(i+1).text.toUpperCase() ;
    			if( (toFind > nextOptionText) &&
    			(toFind < lookAheadOptionText) ){
    				oControl.selectedIndex = i+1;
    				window.event.cancelBubble = true;
    			window.event.returnValue = false;
    			break;
    			} // if
    		} // if
    
    		else{
    
    			// If we are at the end of the entries and the search string
    			// is still higher than the entries, select the last entry
    
    			if(toFind > nextOptionText){
    				oControl.selectedIndex = allOptions.length-1 // stick it
    				// at the end
    				window.event.cancelBubble = true;
    				window.event.returnValue = false;
    				break;
    			} // if
    		} // else
    	} // for
    } // function
    Fremy
    Pour vos développements Web et une navigation agréable, le tout gratuit :
    1) IE 8 + IE7Pro (Si vous ne connaissez pas IE7Pro, essayez !)
    2) FF 3 + Web Developper Toolbar + AdBlockPlus + FireBug + GreaseMonkey

  19. #19
    Candidat au Club
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    14
    Détails du profil
    Informations personnelles :
    Localisation : Canada

    Informations forums :
    Inscription : Mai 2006
    Messages : 14
    Points : 4
    Points
    4
    Par défaut
    Ok merci, j'ai compris.

    Je pensais que window.event.srcElement était supporté partout.

    Comme tu dis, je vais être sur que la fonction va être relié au bon contrôle.

    Merci encore!

  20. #20
    Membre expert
    Avatar de FremyCompany
    Profil pro
    Étudiant
    Inscrit en
    Février 2006
    Messages
    2 532
    Détails du profil
    Informations personnelles :
    Âge : 32
    Localisation : Belgique

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2006
    Messages : 2 532
    Points : 3 239
    Points
    3 239
    Par défaut
    Citation Envoyé par Taore
    Ok merci, j'ai compris.

    Je pensais que window.event.srcElement était supporté partout.

    Comme tu dis, je vais être sur que la fonction va être relié au bon contrôle.

    Merci encore!
    Pour faire plus simple ton code est IE Only window.event est IE Only
    document.all est IE Only (function Find())
    ...
    Je te conseille donc de changer le code...
    Fremy
    Pour vos développements Web et une navigation agréable, le tout gratuit :
    1) IE 8 + IE7Pro (Si vous ne connaissez pas IE7Pro, essayez !)
    2) FF 3 + Web Developper Toolbar + AdBlockPlus + FireBug + GreaseMonkey

+ Répondre à la discussion
Cette discussion est résolue.
Page 1 sur 2 12 DernièreDernière

Discussions similaires

  1. Réponses: 0
    Dernier message: 14/11/2011, 15h52
  2. [VB.Net]Comment faire pour "Ouvrir avec"
    Par NiamorH dans le forum Windows Forms
    Réponses: 6
    Dernier message: 09/09/2006, 17h02
  3. Réponses: 3
    Dernier message: 01/07/2006, 14h04
  4. [VB6]Comment faire pour récuperer des donnée sur un mp3 ou wav ?
    Par MegaBigBoss dans le forum VB 6 et antérieur
    Réponses: 13
    Dernier message: 13/06/2006, 16h08
  5. Réponses: 2
    Dernier message: 22/05/2006, 14h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo