Reputation: 612
What is the best way to close a form's webpage after the submit button is clicked? I want the form to post then close and for the life of me I cant find a good way to do this. I guess if it comes down to it I can do an ajax call then call window.close() when the ajax call completes.
Upvotes: 1
Views: 4821
Reputation: 5264
You can achieve it using jQuery...
$("form").submit(function() {
$.post($(this).attr('action'), $(this).serializeArray());
window.close();
});
Upvotes: 1