+ Start a Discussion
s_macs_mac 

Visualforce page autocomplete input text using jquery

Hi,
I have a text field which autocompletes and displays suggestions implemented using jquery, 
e.g.,
j$(document).ready(function()  {    
        var itemSelected = false;
        j$(esc('{!$Component.autoComp}:acInput')).autocomplete({

           // autoFocus: true,
            minLength: 2,
            create: function(event, ui) {             
                     j$(esc('{!$Component.autoComp}:acInput')).val('');
                   },
            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