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 6841035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:55:00+00:00 2026-05-26T23:55:00+00:00

Hi all I have seen all question related to this problem but couldn’t find

  • 0

Hi all I have seen all question related to this problem but couldn’t find the solution. I am working with jquery ui autocomplete. My scenario is this,

I have a check box. When It is checked, an ajax request is sent to server which fetch some information from database and returned the json encode data. On success function I call the jquery autocomplete and in source I provide the data returned by my ajax request. When I start writing some thing in my text box, (I can see in firebug console tab) a get request is sent having all my option which are returned from ajax request like this

 http://localhost/project/module/controller/index/%5B%22Mobile%22,%22Watch%22,%22Lamps%22,%22Harry%20Potter%22,%22Suitcase%22,%22Halloween%22,%22Xmas%22,%22Multiple%22,%22oil%22,%22Empty%20Keywords%22,%22iphone%20theme%22,%22Edit%20theme%22,%22Final%20Theme%22%5D?term=mo

and nothing happens. There are no options shown as auto complete. My code is as follows

<input type="checkbox" name="prebuilt-Themes" id="prebuilt-Themes" onclick="get_all_themes();">

Text box

 <input type="text" id="themes" style="display: none;" class="ui-autocomplete-input">

And the function which handles ajax request

 function get_all_themes()
{

    if($("#prebuilt-Themes").is(':checked'))
    {    
     $('#themes').show();   
     $.ajax({
            type:'POST',
            //data:({string:'abc'}),
            url: "<?= $this->baseUrl(); ?>/module/controller/getallthemes",
            success:function(data)
            {
               $(function() {
               $( "#themes" ).autocomplete({
                    source: data

                        });
                });
            }
        });
     }


}

The data which I receive from my Ajax request looks like this

  ["Mobile","Watch","Lamps","Harry Potter","Suitcase","Halloween","Xmas","Multiple","oil","Empty Keywords","iphone theme","Edit theme","Final Theme"]

Can anybody guides my what Am I doing wrong?

  • 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-05-26T23:55:01+00:00Added an answer on May 26, 2026 at 11:55 pm

    You need to make the ajax response in json format with id, label, and value like so:

    [ { "id": "Luscinia svecica", "label": "Bluethroat", "value": "Bluethroat" }, { "id": "Motacilla flava", "label": "Blue-headed Wagtail", "value": "Blue-headed Wagtail" }, { "id": "Cyanistes caeruleus", "label": "Blue Tit", "value": "Blue Tit" }, { "id": "Monticola solitarius", "label": "Blue Rock Thrush", "value": "Blue Rock Thrush" }, { "id": "Anas discors", "label": "Blue-winged Teal", "value": "Blue-winged Teal" }, { "id": "Merops persicus", "label": "Blue-cheeked Bee-eater", "value": "Blue-cheeked Bee-eater" }, { "id": "Tarsiger cyanurus", "label": "Red-flanked Bluetail", "value": "Red-flanked Bluetail" } ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen this similar question on SO in a few places but all
this question has been answered several times and i have seen almost all related
I have seen some demos about the jQuery wizard plugin on websites. But all
I've seen a couple of questions about this particular error message, but couldn't find
Haven't seen many Geneva related questions yet, I have posted this question in the
I have seen some other questions about this but the errors were related to
I have seen numerous ways to highlight the current tab, but they all have
Sorry if this has been answered before, but all the related questions didn't quite
I have seen some of the questions/answers related to this topic here, however still
I have an HBase schema-design related question. The problem is fairly simple - I

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.