Chained autocompleter [parent-child]
Hi guys and girls.
i have a problem chaining two inputs that acting as parent-child.
i have this code that works fine:
-
function lookup(inputString) {
$.post("cities.php", {cities: ""+inputString+""}, function(data){
if(data.length >0) {
$('#suggestions').show();
$('#autoSuggestionsList').html(data);
}
});
}
now in cities.php i want to make onclick function that sends value to another script, streets.php.
i made something like this but it's not working:
-
function sendValue(sValue) {
$.post("streets.php", {city: ""+sValue+""});
}
the php script itself working fine, tested it by putting static values.
i don't use any pluging, it seems easy but it isn't working for me. any help will be appreciated.
thanks.