I’m using jquery autocomplete
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js'></script>
Everything is working Ok., but now I’m trying to add a minChars option which doesn’t do anything. My code looks like this:
$( "#searchid" ).autocomplete({
source: "/autocomplete_url.php?more=1",
minChars:6,
select: function(event, ui) {
$("#searchid").val(ui.item.value);
$("#formid").submit();
}
});
Everything is working, except it disregards the options I’m adding. Why/How can I debug the problem?
UPDATE: according to the answer below, I’ve moved to use minLength instead. I’ve tried adding in two different ways but it doesn’t work :/ This is my “new” code:
$( ".selector" ).autocomplete({ minLength: 6 });
$( "#searchid" ).autocomplete({
source: "/autocomplete_url.php?more=1",
minLength:6,
select: function(event, ui) {
event.preventDefault();
$("#searchid").val(ui.item.value);
$("#formid").submit();
}
});
Thanks
It’s not
minCharsbutminLengthsee http://jqueryui.com/demos/autocomplete/#option-minLength