Hi all,

first of all I'm sorry if this posting is hard to read. English is not my mother tongue.

I'm new to jQuery and jQuery-Autocomplete. I want to create an "intelligent" input form like

Name: ____________
ZIP: _______
City: ____________
Street: _____________

If the ZIP-code is entered the city is filled automatically. That works. What I want is an autocompletion for street. In my database I have a list of all streets and the appropriate ZIP-codes
e.g.

34128 / A-Road
34128 / B-Road
34128 / B-Street
34128 / C-Street

If the ZIP-Code is 34128 and the first key pressed in the street-field is a "B", then only B-Road and B-Street should be shown in the autocomplete list.

I have the following code fragment, taken from the demo (json.html) and adapted to fit my needs.

$("#street").autocomplete('search.php?what=street&add='+$('#zip').val(), { ...


search.php receives $_GET[q] the input of the user, in $_GET[what] what to search for (street, ZIP, ...) and in $_GET[add] is stored an additional parameter (ZIP in this case).

The problem is, that I cannot send the value of the ZIP-code to search.php. I tried with the example above and with

$("#street").autocomplete('search.php?what=street&add='+form.ZIP.value, { ...

In this case, the additional parameter $add contains form.ZIP.value and not 34128.

If I write
$("#street").autocomplete('search.php?what=street&add=34128', { ...

everything works fine.


Thank you in advance for your help and hava a nice weekend.
--
Frank Becker

Reply via email to