Pass E2PDF Shortcode Value to Form Field

Formidable Forms
3 June, 2022 10:31:28
MC
Topics: 8
Messages: 15
Strange use case:

In a Formidable View, click a link to pass E2PDF shortcode for the selected record as a URL variable to a text field in a form so that the text input in the form gets the full path to the selected record's %uid% using the get param or frm set get param:

text input receives via Formidable default field value [get param=' '], as: https://whatever-is-in-e2pdf-url-settings.com/efcb9262x5cbef97403f1077986b2s22

How can I make that happen? nay help is greatly appreciated, as always :)
3 June, 2022 10:32:39
MC
Topics: 8
Messages: 15
*any help, not "nay" :/
3 June, 2022 11:08:58
E2Pdf
Support
Topics: 7
Messages: 3163
Hi,

Unfortunately there is no easy way to accomplish. In theory it must be built some custom ajax request which will be connected to the link. When ajax will be fired it must be generated shortcode via PHP as:

$url = do_shortcode('[e2pdf-download id="1" dataset="123" output="url" esc_url_raw="true"]');

* where "1" is the Template ID and "123" Entry ID (must be dynamic).

After you get URL you will need to update Formidable Forms Entry via PHP.

P.S. If you need to output just PDF download in backend when you "View" or "Edit" Entry - there is much more easier way so if you need just this - let us know please and we will share a code snippet.

We remain at your service.
We would really appreciate your feedback at WordPress.org!
3 June, 2022 11:14:15
MC
Topics: 8
Messages: 15
Thank you for the reply. I am interested in the code snippet. Can you share that with me?
3 June, 2022 11:18:30
E2Pdf
Support
Topics: 7
Messages: 3163
It must be added to functions.php or as PHP Snippet: https://codeshare.io/RbeAjj

It must be changed:
"22" - to your Form ID
"1" (inside shortcode) - to your E2Pdf Template ID for that form.

We remain at your service.
We would really appreciate your feedback at WordPress.org!