bootstrap-ajax-typeahead icon indicating copy to clipboard operation
bootstrap-ajax-typeahead copied to clipboard

what if i want to send two values as search parameter ?

Open manikantareddygk opened this issue 10 years ago • 2 comments

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){ ....... };

manikantareddygk avatar Mar 15 '14 18:03 manikantareddygk

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... .

behzadev avatar Jul 23 '14 09:07 behzadev

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" } } }

elartey avatar Mar 04 '16 15:03 elartey