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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:17:48+00:00 2026-06-03T13:17:48+00:00

I am new to jQuery. I am trying jQuery autocomplete remote data source here

  • 0

I am new to jQuery. I am trying jQuery autocomplete remote data source here is my code:

HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title></title>
    <meta name="GENERATOR" content="Quanta Plus">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

    <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
  </head>
  <body>
    <meta charset="utf-8">
    <style>
      .ui-autocomplete-loading {
        background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat;
      }
    </style>
    <script>
      $(function() {
        var cache = {},
            lastXhr;
        $( "#birds" ).autocomplete({
          minLength: 2,
          source: function( request, response ) {
            var term = request.term;

            if ( term in cache ) {
              response( cache[ term ] );
              return;
            }

            lastXhr = $.getJSON( "search.php", request, function( data, status, xhr ) {
              cache[ term ] = data;

              if ( xhr === lastXhr ) {
                response( data );
              }
            });
          }
        });
      });
    </script>
    <div class="demo">
      <div class="ui-widget">
        <label for="birds">Birds: </label>
        <input id="birds"  value="" />
      </div>
    </div><!-- End demo -->
  </body>
</html>

FILE: search.php

<?php 

require_once("includes/connection.php");

$q = strtolower($_GET["birds"]);
echo $q;
$return = array();

$query = "SELECT title
  FROM `project`
  WHERE `title` LIKE CONVERT( _utf8 '%$q%'
  USING latin1 )";

$resultset=mysql_query($query,$connection);

$json = '[';
$first = true;

while ($row = mysql_fetch_assoc($resultset)) {
  if (!$first) {
    $json .=  ',';
  } else {
    $first = false;
  }

  $json .= '{"value":"'.$row['title'].'"}';
}

$json .= ']';

echo $json;

?>

getting the following error:

Notice:
Undefined
  index: birds in /var/www/html/workbench/sudeepc/project/search.php
  on line 4
    [
      {"value":"chandrayaan"},
      {"value":"Project Management System"},
      {"value":"shoping cart"},
      {"value":"hospital management system"}
    ] 

fire bug show the following error while searching on that text box and there is no suggestion for search.

How to resolve this problem?

  • 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-03T13:17:51+00:00Added an answer on June 3, 2026 at 1:17 pm

    As per the comments, it appears that the first error was caused by looking for the wrong $_GET variable. Props to you for spotting that with Firebug and correcting it appropriately.

    The reason that it is not filling in a value currently is because of the extra string echoed in front of the JSON. Remove the line echo $q; and it should work.

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

Sidebar

Related Questions

I'm toying with the new autocomplete in jQuery 1.8-UI. I've provided data in the
Im trying to implement an asp.net textbox using the jQuery UI Autocomplete widget http://jqueryui.com/demos/autocomplete/#remote
I am trying to implement the jQuery autocomplete plugin by receiving the data through
I am new to jquery & autocomplete, and am trying to learn them. The
I'm new to jquery and trying to accomplish something. My HTML looks like: <li>
All, I am new to JQuery and trying to write JQuery code to create
Fairly new to jQuery, trying to use Autocomplete. Went to http://jqueryui.com/download to build my
I'm trying to use the new autocomplete function in jQuery UI, but I'm having
I'm trying to advance the Jquery-autcomplete function. I want Jquery-autocomplete to create new rows
new to jquery here but I'm trying to learn some different stuff that's been

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.