I am using Jquery Autocomplete in .net project.I do have three dropdownlist and they are using same piece of code .I want to call a function in Change() event only for a particular drop down list.So how to know which element is in running state, means i want to know the id of "this" element, so that i can differentiate between the dropdownlist.
change: function (event, ui) {
debugger;
//alert($(this).attr('id'));
//alert($(this).parent().attr('id'));
alert($('#dvdropdownlist').find('#ddlJournalList'));
if (this.value == "")
{
SelectJournalName("0");
}
if (!ui.item) {
var matcher = new RegExp("^" + $.ui.autocomplete.escapeRegex($(this).val()) + "$", "i"),
valid = false;
select.children("option").each(function () {
if ($(this).text().match(matcher)) {
this.selected = valid = true;
return false;
}
});
if (!valid) {
// remove invalid value, as it didn't match anything
$(this).val("");
select.val("");
input.data("autocomplete").term = "";
return false;
}
}
}
})
.addClass("ui-widget ui-widget-content ui-corner-left");