I have a form:
<form action="bar.php">
<input type="hidden" name="foo" value="<?php SOME_STUFF(); ?>" />
<input type="submit" />
</form>
which acts on a PHP script that generates a PDF from the form开发者_StackOverflow社区 contents:
/* bar.php */
<?php
$html = $_POST['foo'];
$pdf->$writeHTML($html);
$pdf->Output('bar.pdf');
?>
And my client would like this to open in a new window. I know HTML won't validate a target
attribute for a form, so must I use JavaScript? And, where?
Try to insert target="_blank" into form tag
and read this http://www.tufat.com/script19.htm about output to pdf
精彩评论