Add Download Link in Formidable Form

28 November, 2018 08:02:09
jstraete
Topics: 34
Messages: 111
I've seen the YouTube video on how to load a PDF of a form after the Submit button is clicked on a Formidable Form, but is there a way to add a separate button / link in a form that will do the same thing? Why I ask is because when a form is submitted, I ideally want to redirect the user to a URL rather than display a message, so if there is a way to insert a button or link inside the form so they could click on it and generate the PDF that way, that would be ideal. Thanks!
28 November, 2018 08:50:23
E2Pdf
Support
Topics: 7
Messages: 3163
Hi,

If you need data from this form in PDF, no, it's not possible by default, as PDF with current data can be generated only after entry submit/saved.

In theory it's possible to complete such task but it will require to use hooks with PHP coding.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
28 November, 2018 08:53:57
E2Pdf
Support
Topics: 7
Messages: 3163
As a solution it can be some "checkbox" inside form and depending if it's checked you can show "Download" link or "Redirect" user.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
28 November, 2018 09:23:20
jstraete
Topics: 34
Messages: 111
Ok so just to clarify, putting the shortcode in a form's Message box for what appears when submitting a form is the only place the shortcode will work (aside from custom hook / coding options)?

Having a "checkbox" or "download" link inside the form is what I had in mind of doing, but since I don't know how to write code that wouldn't be an option for me. I was also thinking of adding the shortcode on a View's "Detail Page", but I tried that and it didn't seem to work there either.
28 November, 2018 09:45:49
E2Pdf
Support
Topics: 7
Messages: 3163
- [e2pdf-download id="1"] shortcode generates link to download "PDF". So if you put this shortcode inside "Success Message" or "Email" body it will generate the link for current submitted entry.

- Regarding "checkbox" - If you are using PRO version of Formidable Forms task can be accomplished with Conditional Statements.

The shortcode can look like this:
[if 12 equals="something"][e2pdf-download id="1"][/if 12][if 12 not_equal="something"]Can be fired JavaScript for redirect[/if 12]

- As about details page (Formidable View) - It's possible to use [e2pdf-download] shortcode, but you must define "dataset".

Usually shortcode inside Formidable View will look like:
[e2pdf-download id="1" dataset="[id]"] - where 1 is E2Pdf Template ID. [id] will be replaced by Formidable Forms to Entry ID depending how View is configured.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
28 November, 2018 11:43:56
jstraete
Topics: 34
Messages: 111
Using the shortcode [e2pdf-download id="1" dataset="[id]"] inside of the View works perfectly. Thanks!