Use AutoComplete's "extraParams" hook

http://docs.jquery.com/Plugins/Autocomplete/autocomplete#toptions

so it would be like:

$("your state search textbox").autocomplete(
    "/ajax/location.php",
    { extraParams: { type: $("#state").val() } }
);



On Jun 26, 12:34 pm, 01101010001010001010 <herrbenn...@gmail.com>
wrote:
> Hi,
>
> First of all, thanks for the autocomplete code - it's excellent.
> Apologies if this next question is too simple, but I couldn't get the
> answer on google (lmgtfy.com)
>
> I have two autocomplete fields, for address-matching, which for the
> sake of argument could be called state and town.
>
> I have autocomplete on state go to /ajax/location.php?type=state and
> autocomplete on town go to /ajax/location.php?type=town
>
> My location.php script works fine delivering autocomplete results for
> each field individually.
>
> I want to pass the contents of ${#state} to the script when
> autocompleting town (so it will only autocomplete for towns in the
> already-chosen state).
>
> I can't see how to tell autocomplete to pass ${#state}.val in the call
> for town.
>
> Any thoughts gratefully received - and thanks again for the brilliant
> code.
>
> Peter

Reply via email to