Note that there are some explanatory texts on larger screens.

plurals
  1. POI have built autocomplete input box (but there is a problem with foucsout)
    primarykey
    data
    text
    <p>I have built autocomplete input box (but there is a problem with foucsout)</p> <p><strong>Watch this :</strong> <a href="http://www.youtube.com/watch?v=IxlXWfJsSeM" rel="nofollow">http://www.youtube.com/watch?v=IxlXWfJsSeM</a></p> <p>Demo: <a href="http://www.faressoft.org/autocomplete/" rel="nofollow">http://www.faressoft.org/autocomplete/</a></p> <p>My HTML Code :</p> <pre><code>&lt;div class="autoCompleteDiv"&gt; &lt;input type="text" value="" size="60" name="countryName" id="countryName" class="autocomplete"&gt; &lt;ul class="autoCompleteList"&gt;&lt;/ul&gt; &lt;/div&gt; </code></pre> <p>My jQuery Code :</p> <pre><code>$(".autocomplete").focusout(function() { $(".autoCompleteList").css("display","none"); }); </code></pre> <p><strong>result should be like the tags input box of stackoverflow</strong></p> <hr> <p><em>Adding actual code from link. --patrick dw</em></p> <pre><code>$(document).ready(function(){ $(".autocomplete").attr("value",""); $(".autocomplete").keyup(function() { $(".autoCompleteList").css("display","none"); if ($(this).attr("value")!="") { $(".autoCompleteList").width($(this).width()+3); $(".autoCompleteList").css("display","block"); var Value = $(this).attr("value"); $.ajax({ type: "GET", url: "Tags.php", data: "country=" + Value, dataType: "html", success: function(data) { if (data!="") { $(".autoCompleteList").html(data); var re = new RegExp("(" + Value + ")", "gi"); $('.autoCompleteList').html($('.autoCompleteList').html().replace(re, '&lt;span&gt;$1&lt;/span&gt;')); $(".autoCompleteList li").click(function() { $(".autocomplete").attr("value", $(this).text()); }); } else { $(".autoCompleteList").css("display","none"); } } }); } }); $(".autocomplete").focusout(function() { //$(".autoCompleteList").css("display","none"); Watch the video. I can't choose the country. }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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