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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:46:16+00:00 2026-06-01T16:46:16+00:00

Solution: The problem is that in my php code, I have a debug message:

  • 0

Solution:

The problem is that in my php code, I have a debug message: print $_GET[‘term’];
It also return the result to client.

I am implementing search with autocomplete feature, but hitting some issues when connecting to php, here is my code

html:

<input type="text" id="leaderboard_search" />

search.js:

jQuery(function($) {
$( "#leaderboard_search" ).autocomplete({
        minLength: 1,
        width: 240,
        source: 'search.php'
    });
});

search.php:

<?php 
    $values = array('abc','def');
    echo json_encode($values);
?>

When I type something. It just doesn’t show anything. I have debugged into php code, search.php get called with no problem. So I suspect the problem is on jquery side.

I am using jqueryui 1.8

Update: to simplify the problem, I changed to embedded js, but still doesn’t work:

html code:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>

<script>
    $(function() {
    $( "#leaderboard_search" ).autocomplete({
        minLength: 2,
        width: 240,
        source: 'search.php'
    });
});
</script>
<html>
<fieldset class="searchinput"><input type="text" id="leaderboard_search" /></fieldset>
</html> 
  • 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-01T16:46:17+00:00Added an answer on June 1, 2026 at 4:46 pm

    according to the jquery documentation here http://jqueryui.com/demos/autocomplete/

    it states that the result either can be a name value pair or just an array or strings.. so instead u shud echo smthing like this.

    echo '["abc","def"]';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm facing a problem that seems to have no straighforward solution. I'm using java.util.Map
I have a weird problem that i can't figure out a solution for: I've
I am using DllImport in my solution. My problem is that I have two
It is known that the halting problem cannot have a definite solution, one that
I have this quite popular problem, but have failed to find a solution that
The problem: I have a legacy php app that is coded in no particular
Possible Duplicates: Is there a problem that has only a recursive solution? Can every
Is that a problem if a solution contains many projects and there are some
I can't find a solution for that. I managed to solve the problem of
My problem (and solution?) is simple - I hope :) I have a RIA

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.