Welcome Guest, Not a member yet? Register   Sign In
DOMPDF with AJAX JQuery
#1

[eluser]reidz[/eluser]
Hi i have this problem about how i suppose to do, when i want to generate a PDF with domPDF, but i want some data in that PDF comes from my POST variables
I've tried to use some JQuery to post my variable but it just wont work, this is some of my code

JQuery to post my variable task_id
Code:
$.post("/qa/scoring/printDOMPDF", {"task_id": task_id},
        function(data){},"json");

Function in my controller to accept that "task_id" then send it to DOMPDF
Code:
function printDOMPDF()
{
$task_id = $this->input->post('task_id'); // all went wrong went i tried to accept this POST variable
$data['task_id'] = $task_id
$html = $this->load->view('/qa/to_pdf/scoring_lec', $data, true);
pdf_create($html, 'untitled');
}
that POST variable just wont work

now im just using this to call printDOMPDF() function from my Javascript
Code:
location.href= '/qa/scoring/printDOMPDF"';

any help will be appreciated, thanks before


Messages In This Thread
DOMPDF with AJAX JQuery - by El Forum - 09-22-2010, 10:49 AM
DOMPDF with AJAX JQuery - by El Forum - 09-22-2010, 11:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB