Sort of building on a question i asked earlier here
I'm using the jquery ui autocomplete to create a autocomplete form. With your help i've successfully combined the combobox and category options of it together. Now after thinking i'm trying to take it yet another level.
What I would like to do is be able to have the combobox also search optgroup labels as well as the option text. If the text matched the optgroup label the whole category would show, but it would still would search on the option text as well.
I'm guessing the edits need to happen in the block below.
response(select.find("option").map(function() {
var text = $(this).text();
if (this.value && (!request.term || matcher.test(text))) return {
label: text.replace(
new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"),
value: text,
option: this,
category: $(this).closest("optgroup").attr("label")
};
}).get());