views:

25

answers:

1

I am using autocomplete functionality found at http://www.devbridge.com/projects/autocomplete/jquery/. In addition to the text in the autocompelete text box, i would like to pass additional information, like selected states and highways. Following is the code I have. I am getting the text value in the textbox in the MVC action, but not the params. Can you please check what I am doing wrong.

var a = $('.exit-filters div.filters input#Exit').autocomplete2({
    serviceUrl: $('.exit-filters input#exit-autocomplete-link').val(),
        minChars: 1,
        maxHeight: 300,
        width: 70,
        params: { highWays: JSON.stringify($('div.highway-filters input[type="checkbox"]:checked').attr('value')), states: JSON.stringify($('div.state-filters input[type="checkbox"]:checked').attr('value')) },
        zIndex: 9999,
        deferRequestBy: 0, //miliseconds
        noCache: false, //default is false, set to true to disable caching
        // callback function:
        onSelect: function(value, data) { $('.exit-filters div.filters input#Exit').val(data); }
    });
A: 

Actually more a comment (but I'm not yet cool enough ;-)

Have you checked with firebug if the additional params are sent to the server?

John Landheer
I used variations of the above code. When I defined a function for params, it started accepting the multiple values. thanks for your respone.
mohang