StealthRT
StealthRT

Reputation: 10542

jquery autocomplete array help

Hey all i am trying to use my already array that i populated into the jQuery Source:

$(document).ready(function(){
    $("input#partSearchBox").autocomplete({
        source: [partNum]
    });
});

the partNum looks like this:

gh3423645,jh324332,iu45233,gk324456, etc etc...

And i can get to each data by doing this:

partNum[0] or partNum[3], etc...

How can i already use that array within the source? The code i posted above has no suggestions once i start typing?

Thanks!

David

Upvotes: 0

Views: 2010

Answers (1)

Emmett
Emmett

Reputation: 14327

Since partNum is already an array, try using

source: partNum

instead of source: [partNum].

Upvotes: 1

Related Questions