javascript - jquery examples - Jquery: Possible to dynamically change source of Autocomplete widget?

0 Answers

jquery link


I am using the official Autocomplete jquery widget and am having troubles dynamically changing a variable (selectType) I'm passing via the query string. The variable would change depending upon which option is selected via a select box.

$(function() {
var selectType = $('#selectType option:selected').attr("value");    

    selectType = $('#selectType option:selected').attr("value");
    alert (selectType);  // alerts the right value for debugging

    source: "ajaxSearchForClientAddress.php?selectType="+selectType,
    minLength: 3