bootstrap-ajax-typeahead
bootstrap-ajax-typeahead copied to clipboard
what if i want to send two values as search parameter ?
i want to send two values to the server , one value serves type of product and another values serves dropdown value (search value) search = 'value', through Ajax is there any new parameter i have to add in preDispatch() function. please let me know.. exports.getProduct = function(req,res){ var queryname = req.body.params; Product.distinct('product_name',{},function(err,data){ ....... };
any answers to this? I also want to send some variables to source page, like:
var type = $(this).attr(data-id);
and send type
as a variable to source... .
you can do that by using the preDispatch option under the ajax options. So you could do something like this. ajax: { url: "/some/url/here", ..... * other options here * ..... preDispatch: function(queryString){ return { // variable name here. In my case i need to send "text" and "domain" as parameters text: queryString, domain: "some other string to be sent here" } } }