Print Form Button
Autore: Andrew Ford
Visite 2041,
Followers 2,
Condiviso 0
I have been asked 'when I complete a form' on the website can a hard copy of the form be printed - 'Print Form Button'. I am new to constructing websites and unsure how to create such a button. any advice would be greatfully recieved. Thank you.
Postato il
Hello Andrew
Somehow you have to emulate the printscreen function, as you have to make it happen on the users device.
So - you could take a look here : https://www.phpclasses.org/blog/package/9530/post/1-PHP-Tutorial-on-Web-Page-Screenshot-Capture.html
But why not let the user take prtscrn or tell the user to use CTRL P.
You could also simulate the ctrl p by making a button for that.
https://stackoverflow.com/questions/30711523/how-to-execute-keybord-shortcut-ctrl-p-by-clicking-a-link-using-jquery
Andrew, for anything more complex than an email contact/enquiry form I always create 2 forms, one as a pdf designed to be printed & filled in by hand with a link to it above the online form.
However, a confirmation copy to the user can be automatically sent when the form is submitted and in the majority of cases this is sufficient. This is my contact form.
& as the person who filled out the form, this is what I received as email confirmation.
Hi Andrew,
If you want your users to download a hardcopy of the empty form from your website then you can create a download button and set a .pdf file to be downloaded. Fot his you have to create same form in pdf format first.
As Esahc said that a confirmation mail will be sent automatically to the person who filled the form, its right.
If you want your user to download the form they have filled then you have to enable the confirmation email.
If you have any issue keep posting. We the member of Incomedia family always happy to help.
Thank you
Hello Andrew
My suggestions was based on the fact, that the user should be able to see also the data he had filled in the form.
It is correct that a confirmation mail can/will be sent to the one that fills out the form, but I was maybe to focused for an answer to what you asked for.
You could put this on the page with the form :
<input TYPE="Button" VALUE="Print" ONCLICK="window.print()">
You have the mail-form and just under the mail for you put an html-object with the "code" supplied in my former post.
This will do that you have the mailform with eventually some data from the user.
If the user clicks the "Print" button, then the browsers print function will be invoked, and the user can print the page with the form+data to his local printer or to a pdf if he has chosen such one as his local printer.
I hope this was what you asked for.
I could not resist to test it myself. I put it on my calendarforum.
You can see how it functions here : http://www.calendarforum.dk/contact.html
To print the page, perhaps you could simply assign and use the expected connection:
>> Step 4 - Pages > Common features > The Link window > Commands in the Action section | Print Page: You can create a link to print the page on display.
(IT) - Per stampare la pagina, forse si potrebbe assegnare ed usare semplicemente il collegamento previsto:
Print Page: You can create a link to print the page on display.
.
ciao
.
The benefit of using html for this, is that the button will look the same as the buttons in the mail form - if you use the standard button.
But what KolAsim tells, is a general feature. You can use this everywhere you can specify a link. It could also be an image in a text-object that was given a "link" to print the page.
The function to print the page is exactly the same whatever you use the html or the link method. Both uses the window.print()