I want to create a form using javascript and then submit that form. On the other side of the submission is an API that is programatically building a PDF for the user.
The following works in Chrome, but not IE or Firefox:
function downloadPdf () {
var form = document.createElement("form");
form.setAttribute("action", "http://internal.site.com/downloadPdf");
form.setAttribute("method", "POST");
form.setAttribute("target", "_blank");
form.submit();
};
What am I doing wrong here?
And for the record, this is a simplified version of the function without all the complicated stuff that would show why I want to do it this way. :)