Javascript: Set URL attached to a form submit button dynamically.

New Here ,
Aug 18, 2022 Aug 18, 2022

Copy link to clipboard

Copied

Looking to dynamically the URL attached to a form submit button. The PDF form has a submit button which runs two actions upon being triggered:

1. Submits the form via doc.submitForm(), this is submitted to a proxy server which processes the form data transfer, saves the data to a local database, then forks a form template with the same layout as the one submitted and fills it in with the submitted data. 

2. Routes the end-user to a domain website, where the user is thanked for their submission. 

All this works already. However, we need a handshake at the end of this all. Meaning a way for us to allow user to verify input data, giving us a way to finalize the entire flow of data from the PDF form to the CRM, while also giving us a means to send the end-user as well as ourselves, a copy of the PDF form filled in with user's submitted data.

My idea is to simply manipulate both URLs attached to the form button. However, using "Expert PDF" I haven't figured out or found a way of manipulating the two URLs attached to that submit button. Yet, I know it is more than likely possible via JavaScript.

Any ideas?

How will this help with the handshake question? Well we'd create a datetime stamp, or even a GUID string, that would be appended to both URLs query strings, in turn allowing me to match calls two both servers at the foot of the process.

As stated before, everything else works now, just need to append data to those two URLs attached to the button using JavaScript. I'd implement it using "Expert PDF".

Thank you, in advance, everyone.

TOPICS
Edit and convert PDFs , How to , JavaScript , PDF forms

Views

34

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 19, 2022 Aug 19, 2022

Copy link to clipboard

Copied

It's possible, but where do you want this unique identifier to be generated? On the server or in the script that runs within the PDF file itself? The latter is much easier to achieve, of course.


PS. "Expert PDF" is not an Adobe product. You will get responses here on how to do it in Adobe Acrobat. Whether that's the same in the application you're using, or whether it works there at all, is beyond the scope of this forum.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

In the script within the PDF would be great, easier to ALWAYS have a unique form being passed through, in essence, a fingerprint of epoch 🙂

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 24, 2022 Aug 24, 2022

Copy link to clipboard

Copied

LATEST

So, I've come to a final version of this process and solution. Works amazingly great. If people need help with their PDF flow, from HTML document form to, PDF submittable form, to PDF data form capturing and in turn PDF document template filling, and emailing/sharing, let me know 🙂

Love the whole process.

I'll show you what I've done with PDF multi-page anchors later, fluent with online/offline paging between web-based and in-document pdf based flow, been using that over a decade now, all by using HTMLDOC 🙂

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines