Hello every one :)
I wont to create a pdf from a form on my page, but the Problem is, I need it excactly like the page with form, all entires.
So I have for example
2 Input Fields, 7 Radio, 2 Checkboxes, and as result i need a PDF with the same sructure, but if someone check the checkbox, it must be saved in pdf.
I have tryed to save the html content of the page on submit, and save it first in html file, but the problem is, my selections woundn't be saved.
The result must have the same as i would print my form.
I hope someone can help.
The Code i using to save the page content.
> $(document).ready(function(){
> $('input[type=submit]').click( function() {
> var formname = $("body").find("form").attr("name");
> var htmldata = $("form[name="+formname+"]").html();
> var enchtmldata = ncodeURIComponent(htmldata);
> $.ajax({
> type: "post",
> data: "data="+enchtmldata,
> url: "makepdf.php",
> success: function()
> {
> alert("success"); },
> error: function() {
> alert("error"); } });
>
> }); });
PS: I using PHP and jQuery
ADDED: I think it is better to try first of all to save the form page as html, but to keep the entries in it. After that to try to convert it. But the Problem is, to save it with all data.
ADDED: how can I add a attr selected to an option field?