Response title
This is preview!
$("#land").change(function(){
$.myvariable = $("#land").val();
return $.myvariable;
});
$("#plz").autocomplete("searchplz.php?land="+$.myvariable,{
minChars: 1,
width: 200,
autoFill: false,
mustMatch: true,
formatItem: function(data) {
return data[0] +" "+ data[1];
},
formatResult: function(data) {
return data[0];
}
});
var test;
$("#land").change(function(){
test = $("#land").val();
});
$("#plz").autocomplete("searchplz.php?land="+test,{
minChars: 1,
width: 200,
autoFill: false,
mustMatch: true,
formatItem: function(data) {
return data[0] +" "+ data[1];
},
formatResult: function(data) {
return data[0];
}
});
For remote data: When the user starts typing, a request is send to the specified backend ("my_autocomplete_backend.php"), with a GET parameter named q that contains the current value of the input box and a parameter "limit" with the value specified for the max option.
A value of "foo" would result in this request url: my_autocomplete_backend.php?q=foo&limit=10
extraParams : { d: $("#land").val() } ,
function() { return $("#land").val(); }
© 2013 jQuery Foundation
Sponsored by and others.