Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

HELP!! How do I create hyperlink in a text field?

Avatar

Former Community Member

Hi!

I've been going through the message boards and I am not finding my answer.  I have created a form utilizing LiveCycle.  I have made the form so that it can be fillable via Reader Extended PDF.  I need to be able to put a link in a text field that the next user can just click on it, and it will take them to a document in SharePoint for review.  I've tried changing the text field to rich text in LiveCycle, but the steps to add the link in the PDF is too lengthly and not friendly.  Once I finally get it to put the link in, the end user cannot just click on it.  They have to take additional steps.  Someone on the boards mentioned something about putting a button next to the field that will convert the text of the link in the previous text field to a link, but I cannot find those instructions or understandable instructions.  The management wants it to be where you just click on the link.  How do I do this?  I am not a techie, so I need instructions in layman's terms.

PLEASE HELP!

Thank you!

Maribeth

10 Replies

Avatar

Level 8

If you have text with http://web.com then it will be interpreted as link.  If you need to do this dynamically use a floating field

Avatar

Former Community Member

Thanks for your help!  However, that's the problem... it's not being interpreted as a link.  Here is a sample of what I am putting in the PDF form:

http://thehub/sites/Legal/... (I did not put the full link here on the board) 

Also, I don't know what a floating field is.  I've had to teach myself how to use this product, so there is no one for me to ask.

Thanks again!

Avatar

Level 7

I'm in the same boat as you, inasmuchas I taught myself LC. I've tried to replicate your issue. I'm trying to understand where the issue actually lies.

First, I created a new document to test. I dragged the text field onto the document and stretched it to accomodate what I was going to type and entered: http://www.google.com/something

example.png

This works as intended.

Next I tried a link similar to yours in our own intranet: http://intranet/WebPages/support.aspx

That also worked.

Now, for what you're actually working with: a SharePoint document.

I tried to paste a link to a document that I created on our Sharepoint site. The link failed! I noticed that the end of the link was truncated (something like 7 characters). So, I tried a shorter link. That worked!

What else is happening when they click the link? Are they simply being asked to "check out" the document? Are you getting an error message like "an error has occured while opening the page"?

Message was edited by: jasotastic81 (apparently "lnik" is not a word)

Avatar

Former Community Member

I tried typing in http://www.google.com and it is not even recognizing it as a link.  Maybe I have something set up wrong.

Avatar

Level 2

Sounds like you want one user to type or paste a URL into a text field and then another user to be able to click on the text in the text field and be directed to that URL.

I believe the recommendations above were all referring to static text rather than text fields.

I think what you need to do is add a button next to your field.  In the click event on that button, add the following code (substituting the name of your text field):

    xfa.host.gotoURL(TextField1.rawValue);

This should give you the desired result.

Avatar

Former Community Member

Justin Klei, You are right on what I want to do. 

Now for what is probably a stupid question... where is the click event on the button? I don't see anything that says that.  I see "control type" with radio buttons or: regular, execute, and submit.  When I click to change the control type, I don't know where to enter the information you provided.

I'm sorry if it is something really easy, but I'm not catching it.  Thank you for your patience!!

Avatar

Level 2

Select your button, then open the script editor (Window-->Script Editor).

In the script editor you'll see a dropdown that says "Show:  Events with Scripts".

Select "Click" from the dropdown.

Paste the code I provided into the editor.

For the "Language" dropdown make sure "JavaScript" is selected and not "FormCalc".

That should do the trick.

Avatar

Former Community Member

YOU ARE THE BEST!!!!!!  Thank you so much!!!!!!

Avatar

Level 6

Here's an alternative solution for future site viewers:

var oLink = TextField1.rawValue;//Change to name of field containing link

if(oLink != "" & oLink != null)

{

  app.launchURL(oLink, true); //This will launch your default web browser and will attempt to open link in window

}

else if (oLink == "" | oLink == null){

  app.alert("No link found");

}

Avatar

Level 1

It seems the above workaround does in fact work from the OP's response but I'm still having trouble with the actual script I type in the editor.

Could one of you supply the script for a simple URL like http://www.yahoo.com so I can see an example once you select Click and add the script, an example spelled out in full below please.

thanks

Justin Klei

Maribethlm