This is what I did:
var tagStudies = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('text'), queryTokenizer: Bloodhound.tokenizers.whitespace, remote: { url: "autocomplete/study", replace: function(url, uriEncodedQuery) { study = $('#study').val(); ssp = $("#social-security").val(); return url + '?q=' + uriEncodedQuery + '&s=' + study + '&ssp=' + ssp }, filter: function (parsedResponse) { return parsedResponse.studies; } } });
Take a look at the replacement feature. The first parameter is url, and the second is what the user types. I did concatenation to pass the request and 2 additional parameters. If you copy the code, be sure to replace the "text" with the "value" in the datumTokenizer. Hope this helps.
source share