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

Stamp results into one text field

Participant ,
Apr 06, 2019 Apr 06, 2019

Copy link to clipboard

Copied

I made a stamp that works. It fills in the individual text fields. It's based on the app.response type. What I'd like to do now is, is to have all the selections populate into one text field instead of populating each of the individual text fields. In essence to compose a sentence of the selection information I make. I need help doing it can someone chime in as to how I can accomplish this? If this can be done? A little example would be very helpful. Thanks.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

475

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 1 Correct answer

Community Expert , Apr 10, 2019 Apr 10, 2019

Change each line to:

msg+=app.response("Enter something:") + " ";

Votes

Translate

Translate
Community Expert ,
Apr 09, 2019 Apr 09, 2019

Copy link to clipboard

Copied

You can do it like this:

var msg = "";

msg+=app.response("Enter something:");

msg+=app.response("Enter something else:");

msg+=app.response("Enter something different:");

this.getField("Text1").value = msg;

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
Participant ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

That worked! But, there needs to be a space between the responses. The way it is now all the responses are mushed together as one word. Hope you have a nice trip, remember your sunscreen.

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 ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

Change each line to:

msg+=app.response("Enter something:") + " ";

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
LEGEND ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

You can add the space to the start of the 2nd and 3rd lines:

var msg = "";

msg += app.response("Enter something:");

msg += " " + app.response("Enter something else:");

msg += " " + app.response("Enter something different:");

this.getField("Text1").value = msg;

If you expect a response to be empty the script becomes more complex.

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
Participant ,
Apr 10, 2019 Apr 10, 2019

Copy link to clipboard

Copied

LATEST

good point, I didn't think if there wasn't a input. How would you handle that?

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