how do I avoid a server request in typeahead.js if certain regex matches? I dont't want to start a suggestion if numbers are typed in but letters should start the ajax request.
Is this possible in typeahead.js or bloodhound?
I still have version 0.10.5 as an update would affect in too many places.
best regards Eike
I found a solution by myself: Just return false in beforeSend.
engine = new Bloodhound({
ajax: {
url: "example.com",
beforeSend: function() {
return null === $(<selector>).typeahead("val").match(/regexIdontWant/);
}
}
});