jquery mobile mPDF not rendering on form submission

Posted by Adam on Stack Overflow See other posts from Stack Overflow or by Adam
Published on 2014-06-07T15:21:28Z Indexed on 2014/06/07 15:24 UTC
Read the original article Hit count: 180

Filed under:

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!

© Stack Overflow or respective owner

Related posts about jquery-mobile