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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:08:12+00:00 2026-05-12T06:08:12+00:00

I am trying to make it easy form my end users to search through

  • 0

I am trying to make it easy form my end users to search through my sites by autofilling the search box when the user types in a word through using ajax calls.

Now first I will show you my code so far and then I will add the questions I have.

Here is the HTML:

<input type="text" id="searchfield" name="q" >

And the jquery:

jQuery("#searchfield").keypress(function(e){
        var searchval = jQuery("#searchfield").val();       
        console.log(searchval);

        /*
        jQuery.ajax({
            type: 'POST',
            url: 'ajax_handler.php',
            dataType: 'json',
            data: {
                search: searchval
            },
            succes: function(data){
                console.log("good");
                console.log(data.msg);
            },
            error: function(data){
                console.log("error");
            }

        });
            return false;
        */  
    });

note: I am using jquery 1.3.2.min.js

  1. Now when I log the searchval like this, every time i see my searchterm in the console. But when I uncomment my ajax request after typing a letter my input box becomes empty.
  2. When I Incomment my ajax and look in firebug when I add an letter to my searchox the value of search in my ajax request seems to be empty. How come?
  3. How to I get a dropdownlist under by textbox containing the suggested values. Assuming the values I get back from the ajax requests are ok. (I probably neet to add the values to an html object, but which one? and how?)

This is all based on this tutorial: Link to tutorial

I hope some one can help me. Thanks anyway!

  • 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-12T06:08:12+00:00Added an answer on May 12, 2026 at 6:08 am

    I think the problems with 1. and 2. are related to sentence “return false;” at the end of your function. Delete that and try again.

    As for autocomplete i suggest you to not to invent bike and search for autocomplete plugins like this one: http://www.pengoworks.com/workshop/jquery/autocomplete.htm

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

Sidebar

Related Questions

I am trying to load a html page through UIWebview.I need to disable all
I'm trying to build a C++ extension for python using swig. I've followed the
I am playing with TFS 2010, and am trying to setup a build process
I'm trying to write test harness for part of my Android mapping application. I
I'm trying to build a Chrome browser extension, that should enhance the way the
I am trying to redirect to a specific path based on HTTP_HOST or SERVER_NAME
I am trying to understand the practical difference during the execution of a program
I have several USB mass storage flash drives connected to a Ubuntu Linux computer

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.