jQuery-Autocomplete icon indicating copy to clipboard operation
jQuery-Autocomplete copied to clipboard

include extra parameters is not working

Open gags88 opened this issue 12 years ago • 2 comments

i am trying to include value of select box in the service URl method, But m getting response as

val_sec.php?lo=&query=[automcompleteoptions] var xc = $('#city_loc').val(); // Dropdown vaue here var ac = $("#name_loc").autocomplete({ serviceUrl:'includes_fm/validate_del_sec', //tell the script where to send requests delimiter: /(,|;)\s*/, // regex or character zIndex: 9999, params: {lo: xc}, deferRequestBy: 0, //miliseconds noCache: false, //default is false, set to true to disable caching onSelect: function(value, data){ alert('You selected: ' + value + ', ' + data); } });

Please help to resolve it

gags88 avatar Oct 28 '14 15:10 gags88

When you change value in a drop down then you would need to change params in autocomplete. Or try this:

params: { 
  lo: function () { 
    return $('#city_loc').val(); 
  }
}

tkirda avatar Oct 28 '14 22:10 tkirda

thumbs up!!! however i got it working like below also

onSearchStart: function(q) { q.entity_type = $('#city_loc').val(); }

gags88 avatar Oct 29 '14 05:10 gags88