by using jQuery.ajax():
so, instead of that big form variable:
$.ajax({
type: 'GET',
url: 'admin-ajax.php',
data: { action: 'get_my_form' },
success: function(response){
var table = $(response).find('table'); // you don't seem to use this "table" var
$(response).appendTo('body').hide();
// ...
}
});
Now, the php:
add_action('wp_ajax_get_my_form', 'get_my_form');
function get_my_form(){
// build your form here and echo it to the screen
exit;
}