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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:46:09+00:00 2026-05-31T04:46:09+00:00

Im using jquery to perform a live auto suggest drop down with a search

  • 0

Im using jquery to perform a live auto suggest drop down with a search bar on my site. but Im having an issue, how do I stop the auto suggest box from showing when there isnt anything in the field apart from the jquery example info

enter image description here

////// HTML form with Jquery

        <div id="searchbox_largesearcher_bg">

        <div id="searchbox_signalbg"></div>

        <form id="large-searcher" action="" method="post">

        <input name="large-search-form" id="large-search-form" type="text" size="35"  onfocus="if (this.value == 'Search A Genre e.g. &quot;Hip-Hop&quot;') this.value = '';" onblur="if (this.value == '') this.value = 'Search A Genre e.g. &quot;Hip-Hop&quot;';" maxlength="35" value="Search A Genre e.g. &quot;Hip-Hop&quot;"/>

         <input name="login" id="search_btn" class="search" type="submit" value="" />

         <div id="searchbox_searchicn"></div>
        </form>

        </div>

        <div class="dropdown">

            <ul class="results"></ul>

        </div>

////// CSS

.dropdown {
    -moz-border-bottom-colors: none;
    -moz-border-image: none;
    -moz-border-left-colors: none;
    -moz-border-right-colors: none;
    -moz-border-top-colors: none;
    background-color: #F5F5F5;
    border-radius: 5px 5px 5px 5px;
    box-shadow: 0 1px 2px -1px #000000;
    margin-left: 32px;
    margin-top: -12px;
    padding: 0;
    position: absolute;
    width: 460px;
    z-index: 99;
    }


.results {
    border: 1px solid #A2A1A1;
    border-radius: 5px 5px 5px 5px;
    list-style: none outside none;
    padding-bottom: 7px;
    padding-top: 7px;
    width: 458px;

    }

.results li{
    border-bottom: 1px solid #EDEDED;
    color: #A8A8A8;
    cursor: pointer;
    font-family: helvetica neue,helvetica,arial sans-serif;
    margin-left: 20px;
    margin-right: 20px;
    padding-bottom: 14px;
    padding-left: 25px;
    padding-top: 10px;

    }

.results li:hover{
    background: none repeat scroll 0 0 #EEEEEE;
    color: #A8A8A8;

    }   

//////// Jquery for auto suggest

<script type="text/javascript">

// Large Index Page Live Returns Searcher

$(document).ready(function(){
$('#large-search-form').keyup(function() {

var search_term = $(this) .attr('value');

$.post('inc/resultsgrabber.php', {search_term:search_term}, function (data) {

$('.results').html(data); 

$('.results li').click(function() {
    var result_value = $ (this) .text();
    $('#large-search-form').attr('value', result_value);
    $('.results').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-05-31T04:46:10+00:00Added an answer on May 31, 2026 at 4:46 am

    turned out to be a CSS problem I had padding and borders in some wrong places. the jquery code was totally fine. sorry about that.

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

Sidebar

Related Questions

I'm using jQuery Typewatch but it's no longer maintained and I'm having a problem
I'm using jQuery autocomplete control to perform search on three entities: Owner, Manager and
I am using <input type=search /> textboxes in a jQuery Mobile site. JQM provides
I am trying to perform an ajax.get using jquery within document.ready . But the
I'm using jQuery to perform ajax callback and deal with lot of objects (over
I am using JQuery to perform form submission through an ajax request. I use
Using JQuery I am trying to perform validation and also get the values of
I am using jquery's change() to perform actions when SELECTs of a certain class
I'm using jQuery in an app which registers user clicks to perform a given
i'm using jQuery validate() plugin to validate a form. it does the validation but

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.