I am making ajax call(ASP.NET 3.5) from dropdown change handler and trying to pass dropdown id into ajax call:
$('select.facility').change(function()
{
if ($(this).val() != 0)
{
var params = new Object();
params.facilityId = $(this).val();
$.ajax(
{
type: "POST",
data: $.toJSON(params),
dataType: "json",
contentType: "application/json",
url: "SomeURL.asmx/SomeMethod",
success: function(response)
{
//this is where I need to get a hold of my dropdown,
// $(this) obviously doesn't work, using just to illustrate
$(this).closest('table').next('table')
.find('input.address').val(response.d.Address);
}
}
});
Is there any elegant way to do that?