Karan Thakkar
Karan Thakkar

Reputation: 1467

additional params in Jquery autocomplete

I'm using Devbridge / jquery autocomplete.

i have been trying to send additional parameters in ajax using its option params which is listed In manual

Issue : it does not send the correct input values to ajax request. Instead it sends initial state value of form inputs except the autocomplete input. ( you can check that in console )

i have tired to reproduce the same Here in Fiddle.

other thing i tried is

    onSearchStart: function (query) {
    $('#doc').autocomplete().setOptions({params :$("form").serialize()});
}

From manual onSearchStart: function (query) {} called before ajax request. this is bound to input element.

Upvotes: 0

Views: 1874

Answers (1)

mahe
mahe

Reputation: 547

The 'params' parameter has to be an object:

onSearchStart: function (query) {
    $('#doc').autocomplete().setOptions({params: {parameterA: $("form").serialize()}});
}

Upvotes: 1

Related Questions