Skip to main content
chrisr-frb
Participant
May 9, 2019
Question

Using user entered form field data to code a hyperlink

  • May 9, 2019
  • 3 replies
  • 494 views

Hello,

I am creating a flyer with form fields on it, that will ultimately be flattened to read only by submit button and saved as a PDF.

One of the form fields is for the end user to enter a URL. I named it referralLink

Is it possible to pull the data from referralLink and program it to a hyperlink so that after the form and PDF is flattened and exported, the hyperlink will navigate to said URL.

This topic has been closed for replies.

3 replies

chrisr-frb
Participant
May 10, 2019

I figured this out:

I am simply creating a PDF flyer template with customizable contact and sales rep information. The rep has a unique URL that they will type in to the form, along with their name, title and contact. There is a graphic of a button (created in the authoring too) that I placed a transparent form submit button with the following code:

var linkers = this.getField("referralLink").valueAsString; //referralLink being the field with the URL

app.launchURL (linkers, true); //opens browser window and navigates to URL on click

Elsewhere on the PDF is a SUBMIT button that flattens the form and opens a save as prompt so that the rep can save and reuse the PDF.

I've figured this out. Thanks for your responses.

try67
Community Expert
Community Expert
May 10, 2019

Exported to what format, exactly? You can display the URL as plain-text and it might get picked up, depending on the format.
Anything else is not likely to work.

Thom Parker
Community Expert
Community Expert
May 9, 2019

It depends. Data can be acquired from an URL with a trusted function in Acrobat Professional. This really only works from a folder level script. Can you install an Acrobat script onto all the systems where this form will be used?

The app.launchURL() function opens a web page.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often