jquery-autocomplete
jquery-autocomplete copied to clipboard
Getting user input
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!
This worked for me:
showResult: function(value, data) {
return value.replace(new RegExp("(" + $("#input_box").val() + ")", "gi"), "<strong>$1</strong>");
},