skip to Main Content

I have a table with checkboxes on each row for different actions – one of them is print all, which generates a pdf.

Therefore I want to submit the form to a page that opens in a new tab. How can I achieve this?

var form = $("#formname");
var url = "url.php";
$.ajax({
    type: "POST",
    url: url,
    data: form.serialize(),
    success: function(data) {
        //Success
    }
});

3

Answers


  1. In my opinion it would be easier to modify your HTML code like this:

    <form target="_blank"/>
    
    Login or Signup to reply.
  2. In success block

    window.location = './your.pdf';
    Login or Signup to reply.
  3. Follow these steps:

    1. Submit that form to server
    2. Open a new tab
    3. Get data from server
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search