Jquery Plugins/Autocomplete Special Char problem

Posted by Yetkin EREN on Stack Overflow See other posts from Stack Overflow or by Yetkin EREN
Published on 2010-04-17T17:36:41Z Indexed on 2010/04/17 17:43 UTC
Read the original article Hit count: 318

Hi;

i use that plugin for autocomplate; docs.jquery.com/Plugins/Autocomplete

but i have a problem with spacial chars. if a special char first char of a word, this char has being ignored and if its not first char, chars before that has being ignored.

for example: "slk" cant found but if i type "lk" "slk" found and if i type öd "aöd" found.

i made a test page; http://www.yetkineren.com/Autocomplete/oto.html

and tahts the code thanks..

<html>
<head>
<meta http-equiv="Content-Language" content="tr">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  <link rel="stylesheet" href="jquery.autocomplete.css" type="text/css" />
  <script type="text/javascript" src="encoder.js"></script>
  <script type="text/javascript" src="Scripts/jquery.bgiframe.min.js"></script>
  <script type="text/javascript" src="Scripts/jquery.autocomplete.js"></script>

  <script>

  $(document).ready(function(){

        var gata=[
                  {"text": '21.png resmi aöd', "value": '21.png'}, 
                  {"text": '21.png resmi cöd', "value": '21.png'}, 
                  {"text": '21.png resmi acd', "value": '21.png'}, 
                  {"text": '21.png resmi aéd', "value": '21.png'}, 
                  {"text": '42.png resmi ésd', "value": '42.png'}, 
                  {"text": '63.png resmi aId', "value": '63.png'}, 
                  {"text": '34.png resmi Çsd', "value": '34.png'}, 
                  {"text": '65.png resmi jkl', "value": '65.png'}, 
                  {"text": '65.png resmi Gkl', "value": '65.png'}, 
                  {"text": '65.png resmi ökl', "value": '65.png'}, 
                  {"text": '65.png resmi slk', "value": '65.png'},
                  {"text": '65.png resmi lsk', "value": '65.png'},
                  {"text": '65.png resmi slk', "value": '65.png'}, 
                  {"text": '36.png resmi &#351;lk', "value": '36.png'}
                  ];
        $('#eksampil').autocomplete(gata, {
             width: 300,
             scroll: true,
             scrollHeight: 300,
             matchContains: "word",
             mustMatch: true,
        formatItem: function(row, i) {
             return i+". result <img src='images/" + row.value + "'/> " + row.text
         },
         formatMatch: function(row) {
             //Encoder.EncodeType="entity";
             return row.text
             //Encoder.EncodeType="entity";
             //Encoder.htmlDecode(
             //Encoder.htmlEncode(i);
         },
        formatResult: function(row) {
             return row.text
         }
         }); 

  });
  </script>

</head>
<body>
  <br>
    type "re" for see all: <input id="eksampil" /><br>
</body>
</html>

© Stack Overflow or respective owner

Related posts about jquery-plugins

Related posts about autocomplete