views:

104

answers:

2

Hi All,

I m using autocomplete from

http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/

jQuery Autocomplete plugin 1.1

i managed to get data from server in below form with sepaerator to id as "-", but i dont want to show this id in list while selecting but sending it as hidden data.Please suggest.

Exon: Supplier HJR/VAKJ -1

A: 

try formatItem: function(){ ... }

$("...").autocomplete(data, {
 //.....
     formatItem: function(item) {
        return item.text.substr(0,item.text.lastIndexOf('-'));
     }
 //.....    
})

more on it here.

Reigel
Thanks for quick reply buddy, but i tried it and it is saying item.text is undefined..
Jos
well, never tried that really but I guess, you can check the codes example here... http://jquery.bassistance.de/autocomplete/demo/ just view the page source...
Reigel
but thanks a lot for help.. :)
Jos
A: 

Anybody else can help me on above situation :)

Jos