I have a question regarding PDF creation with DOMPDF. Basically I have a form that submits data to a DB with jquery that looks like below
$('#submit').click(function(){
var submit = $.ajax({
url: 'setController.php',
type: 'POST',
data: dataString,
success: function(msg){
alert("sent");
},
error: function(msg){
alert("fail");
}
});
});
The setController calls my setModel which returns a render of my html after it has submited the data in to the DB. Which looks like this.
$html = $this -> setModel -> setData($arr1,$arr2);
This returns a simple html table.
Then I push this down to dompdf as follows
$this->load->helper(array('dompdf', 'file'));
pdf_create($html, 'report');
My issue is when the button with ID #submit is clicked no pdf is returned as a download. However if I was to navigate directly to my url
"http://www.url/setData"
I am returns with a pdf download with no data in it.
Can anyone with causing a pdf to be downloaded once the Submit button is clicked?
Thank you.