I'm putting together a form that when the submit button is clicked, the form will be converted to a PDF and then emailed, but I'm not sure how to go about setting both of these actions to happen. Any help would be greatly appreciated.
Thanks,
John
Printable View
I'm putting together a form that when the submit button is clicked, the form will be converted to a PDF and then emailed, but I'm not sure how to go about setting both of these actions to happen. Any help would be greatly appreciated.
Thanks,
John
You'll have to use a programming language to convert the data to a PDF. Something like PHP should work.
If you just want the form data e-mailed to wherever, you could do something like...
Code HTML4Strict:<form action="mailto:address@hotmail.com">
...though that would open you up to getting tonnes of spam mailed to that address.
What exactly is this for ?
Are you sure there's no easier solution to the problem ?
Hi :)
No don't use the form action to send emails. That opens outlook and some people don't have it. You can use PHP and use the mail function to send the email.
Cheers.
For the PDF generation look into PHP's PDF Lib... I think that PEAR also has one. Not sure on how good they are though.
I use Java based iReports here at work to generate my PDF's. Just execute a call to the jasper wrapper/server from PHP and Robert is your mother's brother, as they say! :) BOOM! one PDF :)
It only opens Outlook if you have configured your browser to use Outlook as its email application. If you don't have Outlook, you probably won't have done that. :)
Nevertheless, your advice is sound: One shouldn't use mailto links. Not everyone has an email application on their computer. Many use web mail only.
Hi :)
I should rephrase (not to take your remarks off AutisticCuckoo), not all people have accounts on outlook (or the program they configure it to be)
Cheers.
I will probably use something like html2pdf, etc., but this is essentially what I have:
1. Form already put together in Acrobat; would like to use that for online fill and/or print, but had problems in the past with file in browser. Form will have Reset, Print and Submit buttons.
Want user to have the ability to fill online and then convert to PDF(if using an html form instead) and then for that same PDF to be emailed to one email address.
or give the user the opportunity to print out the form to be filled offline and mailed by regular mail.
If using an html form and converting and emailing, I'm not sure how to put the actions in on one submit button that would do both (if entered back to back?). Hope this clears up the original posting.
John
One thing with HTML forms that are printable is, people can choose to fill them out first and then print (I would do this if I were blind fer sure : ) while others print it blank and fill out with a pen later. The point of printing at all being, they can put it in the post and mail it.
So, if you write your HTML form correctly you can avoid a "print" buttons as people can just... print like normal. *erm by "correctly" I mean, no select drop-downs etc : )
For the PDF, is this for people who already have the whole Acrobat suite? Cause crawling through the nasty PDF's at my work (where I don't have any crappy Acrobat products), the text on our website was all like, just fill this in and then mail to us! And it turned out this only worked if you like bought the whole Acrobat Suite for a bazillion dollars or something, couldn't fill them in with just Reader (or Document reader) alone.
I would have convert-to-pdf be a separate button from the regular submit (the form submit would be the action in the form). I would be afraid to try to have a filled-out-but-not-submitted form turned into a PDF-- so easier to just have a PDF version of the blank form for those who like PDFs. The emailing thing... I still would want that form submitted to a server somewhere first, so that not only can the form be checked for validation (was it filled out correctly and completely?) but then also there's a place to store the information filled in, so that an html-to-pdf program has a place to go get those values.
I agree with Stomme, When I do something like this I have two seperate Forms a PDF Form and an HTML form which emails via PHP, I wouldn't bother with the email form being converted into PDF unless you absolutely need it (I would suppose for printing purposes but even then)
Yupp, that seems to be making most sense. Give your users those two options. "Print Form" for those who want to send it by snail mail and "Submit Form" for those who just want to send it online. Skip the PDF conversion. Also, avoid using the mailto method, use a server side script to send the email instead, unless you are OK with getting spammed =)