views:

26

answers:

1

i'm using jquery to invoke JSON-requests and they're triggered form a bunch of autocomplete-fields. I use wildcard-selector and now need to find out which ac-field that fired the event.

...
$( "[id*='_lookupCmb']" ).autocomplete({
  source: function( request, response ) {
    $.ajax({
      ...
      ...
      select: function( event, ui ) {
        //here I want to get the name of the id calling the request...

Thankful for any quickfix or guidance in wiser solution.

ATB

//tom joad

+1  A: 

I believe under the ui argument object is an elem, and origElem, or something of a similar name (might be target, break inside using firebug and drill into it to find out for sure); then you can simply say $(ui.elem).attr('id').

Clint Tseng