How can I print.js to function on my website?

When the user fills out my form and clicks on the button “Print Form”. The HTML form should automatically download as a PDF to the users download folder.

Problem one:

I tried using this third party plugin but can’t get it to function correctly as when I click on the <button type="button" onclick="printJS('printJS-form', 'html')"><p> Print Form </p></button> nothing happens. How can I get this to work? How can I print.js to function on my website? If someone could help me getting it work in my GIT project that would be fantastic! The form is on the portfolio.html page.

Hi Liam

I think the issue might be this line:

<form id="contact-form printJS-form" method="post" novalidate>

Try changing it to:

<form id="contact-form" method="post" novalidate>

Then pass the id contact-form into the onclick function on the button.

Hope that helps :slight_smile: