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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:06:44+00:00 2026-05-28T22:06:44+00:00

Its my html code : <html> <head> <script type=text/javascript src=jquery.js></script> <script type=text/javascript src=jqueryui.js></script> <script>

  • 0

Its my html code :

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jqueryui.js"></script>
    <script>
        $( "#tags" ).autocomplete({
        url: 'Ajax.php?txt='        
        });
    </script>
</head>
<body>
<div class="demo">
<div class="ui-widget">
    <label for="tags">Tags: </label>
    <input id="tags" name="txt" />
</div>
</div>
</body>
</html>

and here is my Ajax.php

<? 
    $val = $_REQUEST["txt"];
    if($val == "251") { echo "its WoooW";}
    else 
    echo "Nothing found";
?>

But it’s not working for autocomplete.
What is my mistake?

  • 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-28T22:06:45+00:00Added an answer on May 28, 2026 at 10:06 pm

    You must wrap your jquery into a function like this:

    <script>
        $(function() {
            $( "#tags" ).autocomplete({
                source: "Ajax.php",
                minLength: 2
            });
        });
    </script>
    

    And you must return json_encoded content from Ajax.php (Example)
    It States within the documentation:

    When a String is used (eg not a set array), the Autocomplete plugin expects that string to
    point to a URL resource that will return JSON data. It can be on the
    same host or on a different one (must provide JSONP). The request
    parameter “term” gets added to that URL.

    <?php
    $val = $_REQUEST["term"];
    
    if($val == "251") { 
        $return="its WoooW 251";
    }elseif($val == "123"){
        $return="its WoooW 123";
    }else{
        $return="Nothing Found";
    }
    
    echo json_encode($return);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, I've got this code: <html> <head> <meta http-equiv=Content-Type content=text/html; charset=iso-8859-1> <script type=text/javascript href=https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js></script>
I am trying to access an HTML table from code behind, and set its
Is there a tag in HTML that will only display its content if JavaScript
Ajax Jquery form not working vs div why its happen and how can i
I am trying to send html via jQuery's $.ajax() method, and then dump the
Ok, here's my code: <!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd> <html> <head> <meta
I am writing a simple HTML code which uses YUI autocomplete (to display suggestion
The jQuery attr() does not update its value on changing. Here is my code
I'm using jquery to populate a dropdown box. Here is my code. <!DOCTYPE html
i have create a form (so it's PHP and HTML hybrid-code). it has ability

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.