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

  • SEARCH
  • Home
  • 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 8825583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:54:52+00:00 2026-06-14T06:54:52+00:00

I using Jquery autocomplete and I have the following code: Client side: $( #tags

  • 0

I using Jquery autocomplete and I have the following code:

Client side:

    $( "#tags" ).autocomplete({
    source: function(request, response) {
        $.ajax({
            url: "get_professionals",
            data: request,
            dataType: "json",
            type: "POST",
            success: function(data){
                alert("hello");
            }
        });
    }  
});

Server side:

function get_professionals() {
    if ($_POST["term"]):
        $professionals = Professional::find('all', array('conditions' => "name LIKE '%" . $_POST["term"] . "%'"));
        foreach ($professionals as $professional):
            echo $professional->to_json();
        endforeach;  
    endif;
}

the URL is right and, in fact, I get the results from server(I checked it from Firebug in “post” tab) but does not shows

  • 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-14T06:54:53+00:00Added an answer on June 14, 2026 at 6:54 am

    The autocomplete requires a label and/or value field to be returned in the data.

    Array: An array can be used for local data. There are two supported formats:

    An array of strings: [ “Choice1”, “Choice2” ]

    An array of objects with label and value properties: [ { label: “Choice1”, value: “value1” }, … ]

    The label property is displayed in the suggestion menu. The value will be inserted into the input element when a user selects an item. If just one property is specified, it will be used for both, e.g., if you provide only value properties, the value will also be used as the label.

    Adjust your query to return what you want in the autocomplete in value and/or label fields.

    SELECT name AS label, id AS value from professionals.....
    

    Or, some other method to return values like the bolded example from the documentation above. For example, you could set the label and value fields in the success function:

    success: function(data) {
        response($.map(data, function(item) {
            return {
                    label: item.name,
                    id: item.id
                    };
            }));
          }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jQuery autocomplete pluggin . I have the following code $().ready(function() {
i'm using autocomplete from jquery... and i have this: $('#name_search').autocomplete({ source: search/name.php, open: function(){
Using jQuery Autocomplete, according to the docs you have to do the following to
I am using jQuery's autocomplete and I have it set up in the following
Im using Jquery widget Autocomplete.My data source is a server-side script which returns JSON
I'm using 'rails3-jquery-autocomplete' gem, but it doesn't have multi column search, but there is
I'm using jQuery autocomplete plugin from jQuery website calling the controller url which return
I am using jQuery autocomplete, and want to have a separate PHP file to
I am using the jQuery autocomplete plugin and have wired up an input field
I have a site with a form with autocomplete using jquery. It works fine,

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.