0
votes

I added autocomplete functionality to a textbox in my application -

    $( "#cplPageContent_ctlInputSrch_txtSearch" ).autocomplete({
        source: aAvailableTags
    });

aAvailableTags is a comma delimited list.

I included - http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js and http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.9/jquery-ui.min.js.

Every time I type something into this text box, I get a JScript runtime error - 'PAGE UP' is null or not an object. -or- 'PAGE DOWN' is null or not an object.

There is a series of about 6-8 errors. What would cause those errors?

2
Can you post your aAvailableTags variable? - Bot
aAvailableTags = namelast,namefirst,email - duckmike
jqueryui.com/demos/autocomplete It needs to be an array. - Bot

2 Answers

0
votes

Make sure that source is an array.

So:

aAvailableTags = ['namelast', 'namefirst', 'email'];

or

aAvailableTags = [namelast, namefirst, email];

if namelast, namefirst, email are already defined.

Here is working code.

0
votes

Try this:

$("#cplPageContent_ctlInputSrch_txtSearch").autocomplete({
    source: $.makeArray(aAvailableTags)
});