Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery autocomplete: matchContains not working
    primarykey
    data
    text
    <p>I have jQuery and the autocomplete plugin setup. Autocomplete works fine and various options I set like width and lookup work okay. But the one thing that does not work is the matchContains option. According to <a href="http://docs.jquery.com/Plugins/Autocomplete/autocomplete" rel="nofollow">the doc</a> "Whether or not the comparison looks inside (i.e. does "ba" match "foo bar") the search results. Important only if you use caching. Don't mix with autofill." But it is not looking inside the search results. For example, "ba" will not find "foo bar".</p> <pre><code>&lt;script type="text/javascript" src="styles/prosilver/template/jquery.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="styles/prosilver/template/jquery.autocomplete.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; // &lt;![CDATA[ /* Zeno */ function translatestyle(text) { var val = document.getElementById('query').value; var lang = '{S_USER_LANG}'.substring(0,2); var list = "{TRANS_LIST}"; var arr = list.match(val); if ( arr == null ) { alert('That is not a valid translation term.'); } else { insert_text('[translate='+lang+']'+val+'[/translate]'); document.forms[form_name].elements[text_name].focus(); } } var a2; jQuery(function() { var onAutocompleteSelect = function(value, data) { $('#selection').html('&lt;img src="\/global\/flags\/small\/' + data + '.png" alt="" \/&gt; ' + value); alert(data); } var options = { serviceUrl: '/projects/autocomplete/service/autocomplete.ashx', matchContains: true, width: 300, delimiter: /(,|;)\s*/, onSelect: onAutocompleteSelect, deferRequestBy: 0, //miliseconds }; a2 = $('#query').autocomplete({ matchContains: true, width: 300, delimiter: /(,|;)\s*/, lookup: "{TRANS_LIST}".split(',') }); $('#navigation a').each(function() { $(this).click(function(e) { var element = $(this).attr('href'); $('html').animate({ scrollTop: $(element).offset().top }, 300, null, function() { document.location = element; }); e.preventDefault(); }); }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload