Autocomplete: to post a additional value from a 2nd input-field to the php-source
Hello at All,
I am using the actual version of the autocomplete-ui-plugin for a lot of fields and all of them are working fine.
Since 2 days I try to find a example or a ToDo for the problems are following in this forum and in the whole web, but can not find one that I am be able to understand.
To post to the php-source the entered value of the input-field-id ZipCode during the input of the field-id Street as extraParam, so the autocomplete shows only the streets of the ZipCode.
Has anybody a easy ToDo for me?
- <script type=\"text/javascript\">
$(function() {
function log(message) {
$(\"<div/>\").text(message).prependTo(\"#log\");
$(\"#log\").attr(\"scrollTop\", 0);
}
$(\"#Street\").autocomplete({
source: \"Server/StreetNames.php\",
minLength: 2,
extraParams : { d: $(\"#PostCode\").val() },
select: function(event, ui) {
log(ui.item ? (\"Selected: \" + ui.item.value + \" aka \" + ui.item.id) : \"Nothing selected, input was \" + this.value);
}
});
});
</script>
This snipe shows what I try, but this is not successful. The PHP-Source can not find the Parameter "d" by GET or POST.
Can anybody help me ?
Many thanks in advance.