I tried for so long to accomplish what you ask (which i think is tell
the server side autocomplete target "what field am i?"), only to throw
up my hands in dismissal...
I finally just did it this way:
say i had:
<input type="text" id="AC_Name" class="ac" />
<input type="text" id="AC_Email" class="ac" />
<input type="text" id="AC_Title" class="ac" />
I just wired up the plugin like so:
$(".ac").each(function() {
$(this).autocomplete(
"target.html",
{
extraParams :
{
id: $(this).attr("id")
}
}
);
});
now "id=AC_Name" or "id=AC_Email" or "id="AC_Title" gets sent along in
the querystring to "target.html"
maybe there's a more elegant way to do it, but i gave up finding
it :-)
On Dec 18 2009, 8:27 pm, Simon Matthews <[email protected]>
wrote:
> I have a number of fields in a grid which are all using auto
> complete. I want the extraParams function to be able to work out
> which field I am in so that I can return a differently filtered list.
> I don't seem to have access to the input variable? Any clues?
>
> Thanks
>
> Simon