Thanks for the reply James,

Got it from http://www.pengoworks.com/workshop/jquery/autocomplete.htm
because it will handle the local array as opposed to the ajax call.

By the way. It will work as the example does as follows:

 $("#inputbox").autocompleteArray(['value1','valued','value3'], {
                 delay: 10,
                 minChars: 1,
                 matchSubset: 1,
                 onItemSelect: selectItem,
                 onFindValue: findValue,
                 autoFill: true,
                 maxItemsToShow: 10
             });

I just need to know how to put that array in a variable because the
array has to be created dynamically when the page opens.


On Aug 27, 7:51 pm, James <james.gp....@gmail.com> wrote:
> Which autocomplete library are you using?
> This one? ->http://dyve.net/jquery/?autocomplete
>
> The most popular one currently is by Jörn 
> Zaffaerer:http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/
>
> That one doesn't have a "autocompleteArray".
>
> On Aug 27, 2:40 pm, RobGMiller <robgmil...@gmail.com> wrote:
>
>
>
> > Coded the following in a page :
>
> > var ArrayVariable = New Array();
> > $(document).ready(function() {
> >      $("#inputbox").autocompleteArray(ArrayVariable, {
> >                 delay: 10,
> >                 minChars: 1,
> >                 matchSubset: 1,
> >                 onItemSelect: selectItem,
> >                 onFindValue: findValue,
> >                 autoFill: true,
> >                 maxItemsToShow: 10
> >             });
>
> > });
>
> > Filling the input box does not present the list of matching array
> > elements. I believe the array has the wrong structure because it is
> > not recognized in  jQuery.fn.autocomplete. options.data is set to null
> > because data.constructor does not return an array.
>
> > The array is filled by looping through all elements of a json stucture
> > returned from an ajax call as in ArrayVariable[index] = jsonResponse
> > [i]. It appears to be a normal array when looking at it with visual
> > studio.
>
> > I've also tried to create a string as in var ArrayVariable = ""; and
> > ArrayVariable = "[ 'elementone', 'elementtwo', 'elementthree']"; but
> > that was not successfull either.
>
> > Can someone indicate the correct structure of the array required.

Reply via email to