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

Button with generated Link

Community Beginner ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

Hi,
I need some little help with a button and javascript. I have a PDF that creates a url from two fields and I want to set this url behind a button. So that the url is not showen in a field just behind the button. The url is also not fixed it depends on what the user select.

 

Any help welcome. I have no idea how to do this.

 

Thanks,

Daniela

TOPICS
Create PDFs , How to , JavaScript

Views

380

Translate

Translate

Report

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

correct answers 2 Correct answers

Community Expert , Mar 04, 2021 Mar 04, 2021

You can do it in the button's Mouse Up script. For example, if the fields composing the URL are URL1 and URL2 you can use something like this:

 

var fullURL = "http://www." + this.getField("URL1").valueAsString + ".com/" + this.getField("URL2").valueAsString + ".html";

app.launchURL(fullURL);

Votes

Translate

Translate
Community Beginner , Mar 04, 2021 Mar 04, 2021

For now I have created a field where the url is displayed. To address this fild I just have to change "URL1" with the name of the field? Right?

Votes

Translate

Translate
Community Expert ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

Not sure what you mean by "I want to set this url behind a button"... Do you mean you want to add the URL as plain-text on the page? If so, you can use a read-only text field, but why not just use the button itself to both show the URL and launch it when clicked?

Votes

Translate

Translate

Report

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 Beginner ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

I dont want to show the url. I just want to pack it into a button. But the url is not always the same. Its generated of to fields. So I dont know how to get this into a button.

Votes

Translate

Translate

Report

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 ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

You can do it in the button's Mouse Up script. For example, if the fields composing the URL are URL1 and URL2 you can use something like this:

 

var fullURL = "http://www." + this.getField("URL1").valueAsString + ".com/" + this.getField("URL2").valueAsString + ".html";

app.launchURL(fullURL);

Votes

Translate

Translate

Report

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 Beginner ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

For now I have created a field where the url is displayed. To address this fild I just have to change "URL1" with the name of the field? Right?

Votes

Translate

Translate

Report

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 Beginner ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

Bildschirmfoto 2021-03-04 um 12.46.43.png

 

Hope the images help to explain it. I have to fileds creating a url. The url is now at text field. But I want this url in the green button.

Votes

Translate

Translate

Report

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 ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

Want you create a URL and use this URL in a button?

Votes

Translate

Translate

Report

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 Beginner ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

yes, I dont want to show the url. But the url is generated of to fields and not always the same url.

Votes

Translate

Translate

Report

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 ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

You can use the Javascript method lunchURL:

Bild1.jpg

Votes

Translate

Translate

Report

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 ,
Mar 04, 2021 Mar 04, 2021

Copy link to clipboard

Copied

LATEST

Use the Javascript action of the button.

Votes

Translate

Translate

Report

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