Dan...

I think it might actually work without those changes you suggested. Problem
is that at the point I'm calling the plugin, it doesn't recognize
"showResults" as a method:

$("#category").autocompleteArray(
        // this array comes from the coupons_edit.cfm file
        catArray,
        {
                delay:10,
                minChars:0,
                matchSubset:1,
                onItemSelect:selectItem,
                onFindValue:findValue,
                autoFill:true,
                maxItemsToShow:10
        }
).click(function(){
        showResults();
});

When I click the input field, I get an error:

showResults is not defined
http://testlogin.dealerskins.loc/admin/coupons/js/coupon_edit.js
Line 130

Any ideas? Also, is Jörn's plugin listed on the jQuery site?


andy

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dan G. Switzer, II
Sent: Thursday, August 28, 2008 11:17 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Dan Switzer's Autocomplete plugin - can I do this...


Andy,

First I'd recommend updating to latest version that Jörn's been managing. I
have no plans on updating my version.

>I'm using Dan's autocomplete plugin in an app and it's working great. I 
>just have one question. I'm loading in all options (around 5-10) into 
>an array when the page loads. I'd like to trigger the list selection 
>screen when the user clicks into the text field. Is this possible?
>
>So if I've got the following in my array:
>["Accessories","Interior","Maintenance","Parts","Service","Tires","Vehi
>cle
>Sales"]
>
>I'd like all of those items to display when the user clicks the text field.
>Then, as they type, it would filter out other options. Or of course 
>they could select it straight away, or type their own.
>
>I thought it would be enough to put a click handler on the input field 
>like
>so:
>
>.click(function(){
>    showResults();
> });
>
>but that doesn't work. Anyone? Dan?

I think you might be able to hack it the way you want by changing the line:

var prev = "";

to:

var prev = null;

And then you'd need the to set the option "minChars" to 0.

I haven't tested this and don't know what else this might impact.

-Dan


Reply via email to