jquery mobile mPDF not rendering on form submission
- by Adam
Im trying to have the user submit form data to a mPDF page the will render a pdf with the data included. The problem Im having is that jquery mobile initializes the mPDF page not allowing the mPDF to render properly.
Im trying to figure out how to stop jquery mobile from initializing the mPDF page. Just a note, when I remove query mobile the functionality works.
HTML
<form id="rxForm" method="post" action="rxPDF.php">
<input type="text" name="dueDate"></form>
</form>
<button id="printPDF">Submit</button>
JQUERY
$('#printPDF').on('click', function() {
console.log('pdf');
$('#rxForm').submit();
return false;
});
mPDF
<?php
include ("library/mpdf.php");
$dueDate = $_POST['dueDate'];
$html = 'The date is '.$dueDate.'';
$mpdf = new mPDF();
$mpdf->WriteHTML($html, 0);
$mpdf->Output();
exit;
?>
I appreciate anyone's help!