How do you find if the response contains the element form
$.ajax({
url : $(this).attr('action'),
type : 'POST',
success : function(response){
if($(response).find('form').length)
{
alert("hii");
}
}
});
Form could be the topmost element of the response or somewhere in middle
According to update: