Stamp results into one text field

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

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Change each line to:

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

TOPICS
Acrobat SDK and JavaScript, Macintosh, Windows

Views

224

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

Stamp results into one text field

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

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Change each line to:

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

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
Apr 06, 2019 0
Most Valuable Participant ,
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
Reply
Loading...
Apr 09, 2019 0
Explorer ,
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
Reply
Loading...
Apr 10, 2019 0
Most Valuable Participant ,
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
Reply
Loading...
Apr 10, 2019 0
Adobe Community Professional ,
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
Reply
Loading...
Apr 10, 2019 0
pdfUser1 LATEST
Explorer ,
Apr 10, 2019

Copy link to clipboard

Copied

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
Reply
Loading...
Apr 10, 2019 0