I changed options to this: {minChars: 3, delay: 300, max: 1000, mustMatch:
true, cacheLength: 1, matchSubset: false}

Here is another oddity:
If I type 'cal poly' everything I've typed simply disappears.  I'm sure this
is due to the must match, but it happens while I'm still in that field.
'cal pol' has matches. Would it make sense to clear it out when the user
exits the field if it doesn't match?  If I type too fast, I might not notice
that cal pol has results and cal poly does not.  Maybe we can have a
ac_error style with an error icon (where the loading icon displays) to show
"no results" to the user?


On 6/28/07 3:02 PM, "Shelane Enos" <[EMAIL PROTECTED]> wrote:

> 
> OK, since I do want a "mustMatch" scenario, I shouldn't worry about the
> first firing of the autocomplete?
> 
> I see a couple of different options related to caching: matchSubset,
> cacheLength.  Do I need to set cacheLength to 1 and matchSubset to false?
> 
> So because of the "comma" even with multiple by default being false, I need
> to set multipleSeparator to something? Do I need to set anything else?
> 
> On 6/28/07 2:54 PM, "Dan G. Switzer, II" <[EMAIL PROTECTED]> wrote:
> 
>> 
>>> OK, I'm responding to multiple emails here.
>>> 
>>> http://education.llnl.gov/jquery/autocomplete.html
>>> 
>>> There is no result or search being called. There is a value attribute in
>>> the
>>> field, but no value.
>> 
>> It's the mustMatch that's triggering the AJAX call. When the autocomplete()
>> is called, it calls the hideResultsNow() function--which if the mustMatch is
>> true, calls the search() function. It's the search() that causes the AJAX
>> operation.
>> 
>> The search() method probably shouldn't be called if the current value is
>> blank.
>> 
>>> I changed the option and now that's working.
>>> 
>>> I think the arrows down in "more" is what is a little deceiving.  That's
>>> what made me try to click on it.
>> 
>> Maybe, but it was a feature that was asked for. Just disable it. :)
>> 
>> Perhaps we'll make the default option false.
>> 
>>> You'll see a couple of examples to try on my page of some other problems
>>> (selected options from the list not being allowed??) only an option that
>>> "starts with" what is typed is allowed.
>>> 
>>> My actual query on the server is like this:
>>> 
>>> if: (action_param: 'q');
>>> var: 'q' = (action_param: 'q')->(split: ' '), 'filter' = string;
>>> iterate: $q, (var: 'qval');
>>>    $filter += "AND school like '%" $qval "%' ";
>>> /iterate;
>>> $filter->(RemoveLeading: 'AND');
>>> var: 'sql' = "select distinct school from universities where " $filter "
>>> ORDER BY school";
>>> inline: -database='candidates', -sql=$sql, -maxrecords='all',
>>> -username=(global: 'su'), -password=(global: 'sp');
>>> records;
>>>    field('school') '\n';
>>> /records;
>>> /inline;
>>> /if;
>>> 
>>> So "ca poly" would result in this query:
>>> 
>>> select distinct school from universities where school like '%ca%' AND
>>> school
>>> like '%poly%'
>>> 
>>> This schools list is encompassing most schools in the US and many from
>>> around the world.  Sometimes even a "narrow" search isn't narrow enough,
>>> which is why I set a high "max".  For instance, there are many schools in
>>> Los Angeles.
>> 
>> You really should disable caching for what you're trying to do. The problem
>> is you're expect your query to always run, but the cache will prevent the
>> query from running again.
>> 
>> When it's searching the cache, it's only going to pull in matches of the
>> *exact* phrase.
>> 
>>> I noticed something else odd with the cache results (maybe it was me
>>> selecting the wrong option).
>>> 
>>> I want to return all univ in ca.  since they are formed like "univ of ca"
>>> or
>>> "ca state univ", I just type "univ ca"  if I run this query directly in the
>>> database, it returns 115 results, but the autocomplete is limiting it to 1
>>> "univ catolica, Nicaragua" (and even if I select it, nothing happens).
>> 
>> Once again, in the Cache, autocomplete is going to look for exact matches
>> only.
>> 
>> As for why values with commas aren't be selected, I think there must be a
>> bug with mustMatch and the new "multiple" feature. Try changing the
>> multipleSeparator option to something like "~" (or another character that
>> won't appear in the output.)
>> 
>> -Dan
>> 
>> 
>> 
> 
> 

Reply via email to