jquery-autocomplete icon indicating copy to clipboard operation
jquery-autocomplete copied to clipboard

Getting user input

Open boogerlad opened this issue 12 years ago • 1 comments

I'm trying to replicate http://stackoverflow.com/questions/2435964/jqueryui-how-can-i-custom-format-the-autocomplete-plug-in-results, but when I look at the method on line 766, there's no way I can extract what the user types and attempt to format it given just the parameters "result". Is there any way to obtain user input by modifying a method? Am I looking at the wrong lines of code or overlooking existing functionality? Thanks!

boogerlad avatar Jun 28 '12 20:06 boogerlad

This worked for me:

showResult: function(value, data) {
  return value.replace(new RegExp("(" + $("#input_box").val() + ")", "gi"), "<strong>$1</strong>");
},

bwaindwain avatar Oct 26 '12 17:10 bwaindwain