+ Start a Discussion

Visualforce page autocomplete input text using jquery

I have a text field which autocompletes and displays suggestions implemented using jquery, 
j$(document).ready(function()  {    
        var itemSelected = false;

           // autoFocus: true,
            minLength: 2,
            create: function(event, ui) {             
            source: function(request, response) {
              apex class called here:

if I enter text  Ind  it shows values/suggestions
But when focus is out, or clicked outside the textbox, Ind which was entered is getting saved 
but  here I want to put validation that value from suggestions is selected,on onblur or on focus out from the input text.

I tried adding select and close functions, adding boolean variable to true if value is selected and checking the variable value in close function. but after validation alert, suggestion text box won't display any suggestions 

Any help? Thanks in advance