Forum Moderators: open
I want to use the autocomplete plugin for jquery with 2 parameters that can change according to countries selected on a dropdown menu. Something like the following where db is the database name and c is the country name. This works when the page loads but I need to refresh these values as items are selected:
$(document).ready(
function(){
$("#txt1").autocomplete(
"/handlers/AutocompleteData.ashx",
{
extraParams: {
db: function() { return $('select[name=mydropdownmenu]').val(); },
c: function() { return $('select[name=mydropdownmenu]:selectedIndex').text(); }
}
}
);
}
);
Also the expression select[name=mydropdownmenu]:selectedIndex').text() seems to return all the text from the menu not only that of the selected index. How can I solve that?
Any help will be appreciated.
Thanks in advance.