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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:15:01+00:00 2026-06-10T03:15:01+00:00

I created a simple jQuery post that returns data every time an user types

  • 0

I created a simple jQuery post that returns data every time an user types in a character in an input field. The problem is that it is not working. Firebug returns no errors. When I type in a keyword FireBug Net shows no requests made. My code is almost a cut and paste from another piece of code that does work. I have no idea what to do and this is not the first time something like this has happened.

Here is the original file.

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

<div id="tag_results"></div>

  <script type="text/javascript" >

  $(document).ready(function() {

  $('#search_tags').keyup(function() {
    var search_term = $(this).val();
$.post('ajax_file.php', {search_term: search_term}, function (data) {
$('#tag_results').html(data);       
    });     
});

  $('#search_tags').bind('keydown', function(e) {
    if(e.keyCode==13){
    e.preventDefault();
    };});  
    });

  </script>

Here is the ajax file.

$search_term = sanitize($_POST['search_term']); 

    if (!empty($search_term)) {

$search = mysql_query("SELECT DISTINCT `tag_name` FROM `tags` WHERE `tag_name` LIKE 

    '%$search_term%' LIMIT 0, 15");

$y = 1;

         while ($results_row = mysql_fetch_assoc($search)) 

        {

        echo '<br><br>' . $results_row['tag_name'] . '<br><br><hr>'; 

                    $y++;

             }}
  • 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-10T03:15:03+00:00Added an answer on June 10, 2026 at 3:15 am

    Well:

    $('#search_tags_').keyup(...
    

    should be:

    $('#search_tags').keyup(...
    

    because I can’t see an element with id="search_tags_" in your example which has:

    <input type="text" id="search_tags" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple JQuery script with hovering effect on some links. The
So I created a simple slideshow with jquery and jquery ui. It works perfectly
I've created a simple placeHolder for some extra javascript in jQuery - The issue
I just created my first jQuery plugin , it is very simple it slideToggle
I am trying to create a simple about page that uses JQuery click to
I'm experimenting for the first time with JQuery/JQUI to create a simple social icon
I have created an Ajax enabled WCF web service that contains this simple method:
I've been working on a simple JQuery dialog form that loads in via AJAX.
I've created a dynamic HTML form that uses jQuery and customizes the form fields
I created a simple Import script that takes a CSV processes it in PHP

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.