Suggestion list on text box skip values
<p>I have added a suggestion list to my text box. With my script I am getting suggestion, But on blur if text is type other than suggested list it removed from my text box and value becomes blank of text box.</p>

<pre><code>    &lt;input name="poetname" type="text" id="poetname"  maxlength="80" onkeyup="lookup(this.value);" onblur="fill();" style="display:none;"/&gt;
    &lt;div class="suggestionsBox" id="suggestions" style="display: none;"&gt;&lt;img src="images/upArrow.png" style="position: relative; top: -12px; left: 50px;" alt="upArrow" /&gt;
        &lt;div class="suggestionList" id="autoSuggestionsList"&gt;&amp;nbsp;&lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>My <code>lookup</code> function</p>

<pre><code>function lookup(poetname) { 
    if(poetname.length == 0) {
        // Hide the suggestion box.
        $('#suggestions').hide();
    } else {
        //alert("Hiiii");
        $.post("rpc.php", {queryString: ""+poetname+""}, function(data){
            if(data.length &gt;0) {
                $('#suggestions').show();
                $('#autoSuggestionsList').html(data);
            }
        });
    }
}
</code></pre>

<p>My <code>fill</code> function</p>

<pre><code>function fill(thisValue) {
    $('#poetname').val(thisValue);
    setTimeout("$('#suggestions').hide();", 500);
}
</code></pre>

<p>I wish if value entered other than suggestion in my text box than on blur my text box shouldn't be empty or null.</p>
