I have multiple forms with id=#REQUESTFORM. To retrieve the correct information when sending data, I use closest command. But same command does not work when I tried using it in success ajax callback. How will else can I receive and print server's response in correct form?
$("[name='respond']").live('click', function() {
$("[name='action']").val($(this).val());
$.ajax({
type: "POST",
data: $(this).closest('#REQUESTFORM').serialize(),
url: "content/requests/index.cs.asp?Process=RespondRequests",
success: function(output) {
$(output).closest('#REQUESTFORM').html(output)
},
error: function(xhr){
alert('Request Status: ' + xhr.status + ' Status Text: ' + xhr.statusText + ' ' + xhr.responseText);
}
});