Skip to main content
Participant
November 21, 2024
Question

Auto Create Links getting cut off

  • November 21, 2024
  • 2 replies
  • 246 views

I have created a purchase order for staff to use when ordering materials and supplies. Currently they are using the fillable form and pasting the web address to the item they want into a field. I want to make this clickable so when it gets to me all I have to do it click on the field and it will take me right to the item they want to order. I have tried to use the auto-create Link function but when I do some web addresses get cut off and it cannot load the page. Is there a fix to this? It works great when the web address is shorter.

This topic has been closed for replies.

2 replies

PDF Automation Station
Community Expert
Community Expert
November 21, 2024

Make sure the text field font size is Auto, and Scroll long text is selected in the options tab of the text field so the URL paste accepts the entire paste.  Then enter the following "On Focus" script in the actions tab:

if(event.value)
{app.launchURL(event.target.value)}

When you click on the field it will open the webpage.

Thom Parker
Community Expert
Community Expert
November 21, 2024

if the URL is in a text field (in this case named "LinkURL"), then this script on the MouseUp action of a button field will open a browser window to the URL. 

 

app.launchURL(this.getField("LinkURL").valueAsText);

 

Change "LinkURL" to the actual name of the field on your form. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
PDF Automation Station
Community Expert
Community Expert
November 21, 2024

Did you mean valueAsString?

Thom Parker
Community Expert
Community Expert
November 21, 2024

Of course, typing too fast. 

 

app.launchURL(this.getField("LinkURL").valueAsString);

 

 

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