Stamp results into one text field

Explorer ,
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, Macintosh, Windows

Views

225

Likes

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

Most Valuable Participant , Apr 10, 2019 Apr 10, 2019
Change each line to:msg+=app.response("Enter something:") + " ";

Likes

Translate

Translate
Most Valuable Participant ,
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;

Likes

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
Explorer ,
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.

Likes

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

Copy link to clipboard

Copied

Change each line to:

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

Likes

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.

Likes

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
Explorer ,
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?

Likes

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