Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I stop my auto suggest drop down from showing before searching
    primarykey
    data
    text
    <p>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</p> <p><img src="https://i.stack.imgur.com/znct8.png" alt="enter image description here"></p> <p>////// HTML form with Jquery</p> <pre><code> &lt;div id="searchbox_largesearcher_bg"&gt; &lt;div id="searchbox_signalbg"&gt;&lt;/div&gt; &lt;form id="large-searcher" action="" method="post"&gt; &lt;input name="large-search-form" id="large-search-form" type="text" size="35" onfocus="if (this.value == 'Search A Genre e.g. &amp;quot;Hip-Hop&amp;quot;') this.value = '';" onblur="if (this.value == '') this.value = 'Search A Genre e.g. &amp;quot;Hip-Hop&amp;quot;';" maxlength="35" value="Search A Genre e.g. &amp;quot;Hip-Hop&amp;quot;"/&gt; &lt;input name="login" id="search_btn" class="search" type="submit" value="" /&gt; &lt;div id="searchbox_searchicn"&gt;&lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;div class="dropdown"&gt; &lt;ul class="results"&gt;&lt;/ul&gt; &lt;/div&gt; </code></pre> <p>////// CSS</p> <pre><code>.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; } </code></pre> <p>//////// Jquery for auto suggest</p> <pre><code>&lt;script type="text/javascript"&gt; // 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(''); }); }); }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload