Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Auto Create Links getting cut off

New Here ,
Nov 21, 2024 Nov 21, 2024

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.

TOPICS
Create PDFs , PDF , PDF forms
240
Translate
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 ,
Nov 21, 2024 Nov 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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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 ,
Nov 21, 2024 Nov 21, 2024

Did you mean valueAsString?

Translate
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 ,
Nov 21, 2024 Nov 21, 2024
LATEST

Of course, typing too fast. 

 

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

 

 

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

Translate
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 ,
Nov 21, 2024 Nov 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.

Translate
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