Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8527339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:31:49+00:00 2026-06-11T08:31:49+00:00

link to fiddle : http://jsfiddle.net/nEapJ/ (working) var items = [{ label : ‘a’, value

  • 0

link to fiddle : http://jsfiddle.net/nEapJ/ (working)

var items = [{
   label : 'a',
   value : 'a',
},{
   label : 'b',
   value : 'b',
},{
   label : 'c',
   value : 'c',
}];

$('input').autocomplete({
    source : items
});​

This code works, but when i want to set source by callback function
then
It’s not working

link to fiddle : http://jsfiddle.net/B3RWj/ (not working)

$('input').autocomplete({
    source : function(request, response){
            response(items);
          }
});​

when i type, ‘a’ then its give a,b,c as result.

So, what am I missing?

thanks, in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:31:50+00:00Added an answer on June 11, 2026 at 8:31 am

    In the callback function it’s up to you to do the filtering..

    Extract from documentation:

    The third variation, the callback, provides the most flexibility, and
    can be used to connect any data source to Autocomplete. The callback
    gets two arguments:

    A request object, with a single property called “term”, which refers
    to the value currently in the text input. For example, when the user
    entered “new yo” in a city field, the Autocomplete term will equal
    “new yo”. A response callback, which expects a single argument to
    contain the data to suggest to the user. This data should be filtered
    based on the provided term
    , and can be in any of the formats described
    above for simple local data (String-Array or Object-Array with
    label/value/both properties). It’s important when providing a custom
    source callback to handle errors during the request. You must always
    call the response callback even if you encounter an error. This
    ensures that the widget always has the correct state.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

JS Fiddle Link http://jsfiddle.net/Xfvpu/1/ Okay so I have a document with xhtml doctype and
Please refer the fiddle http://jsfiddle.net/HCqsM/5/ Here By clicking the 'click' link for the first
First, here is the fiddle link on what I am stucked in: http://jsfiddle.net/FYHMV/ I
UPDATE If you try the form on this link http://jsfiddle.net/Matt_KP/BwmzQ/ the fiddle and select
Here's the fiddle I'm working with: http://jsfiddle.net/Scd9b/ How can I delay the href function
Fiddle link: http://jsfiddle.net/T35fH/ Hi! I m trying to have 2 iframe youtube video player
fiddle link -> http://jsfiddle.net/TZLE3/ I am trying to add boarder around the first second
Here is the link to the JS Fiddle http://jsfiddle.net/NnQLq/ Sorry for the awkwardness and
Take a look at this fiddle : http://jsfiddle.net/3JRU6/ $(document).ready(function(){ var url='http://api.worldbank.org/topic/4?per_page=10&format=json&callback=?'; var query; $('button').click(function(){
I got a CSS question related to this fiddle: http://jsfiddle.net/r584e/ Here the relevant screenshot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.