Skip to main content
June 10, 2016
Question

How to add hyperlink to pdf rich text box (with javascript)

  • June 10, 2016
  • 1 reply
  • 1977 views

I populate a (rich) text box based on a drop down value. would be great if I could add a hyperlink to it based on the drop down value. Is there a way to add hyperlinks annotations via javascript when a drop down value is chosen? If not, is there another type text box or object I can add the text and/or hyperlink to?

thx for your help

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
June 10, 2016

It's only possible to add hyperlinks in a rich text field manually. It's not possible with a script.

You can, however, set the enter field to act as a link when clicked, but I'm not sure that's what you're after...

June 10, 2016

Thx for the quick response

For testing purposes in the (rich) text field, when I enter a default value (ex: https://www.google.ca ) it only shows as text and not a clickable link, so I'm not sure how "you set the enter field" as you say, to act like as a link. Perhaps I'm not setting the correct properties.

Text field properties:

Multi-line - checked

Scroll Long text - checked

Allow Rich Text Formatting - checked

try67
Community Expert
Community Expert
June 10, 2016

I meant to write "set the entire field".
To do that go to Actions and then add a Mouse Up trigger with an "Open a web link" action.

To set part of the text as a clickable link select that text using the mouse and then press Ctrl+E. This will open the Properties Bar.

Then click the More button and you'll be able to do it under the Link tab.