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

How do I add a box next to a title and have it copy that title to another page in a PDF document?

Community Beginner ,
Dec 04, 2018 Dec 04, 2018

Copy link to clipboard

Copied

I am compiling an ebook and want to make it so that the title of each page

can be copied to another page by clicking a box,  each page will be copied

to the same page if box clicked and that page is (Journey Planner)...in adobe acrobat so

correct Javascript required please.....

TOPICS
Acrobat SDK and JavaScript , Windows

Views

809

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 ,
Dec 04, 2018 Dec 04, 2018

Copy link to clipboard

Copied

So you want to create a button that puts a certain text into a text field when clicked? It's simple. Add this code as the button's MouseUp event:

this.getField("Text1").value = "Journey Planner";

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

Hi try67

don't think I was clear about what i want to do....

I want to be able to do this.......300 page book, imported as PDF document into acrobat,

if a click box is checked then the page title will be added to a list. "Journey Planner Page"

the script you have given doesn't work..all I am getting is a dotted square with no text.?

is that because I dont have a text box on the recipient page"JourneyPlanner"?

or is it because the text that I want to transfer is not in a text box?

again thank you for your help

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

So you want to use a check-box and when that box is ticked some text should appear in a text field on another page?

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

yes...text field on that page(page where text is to appear) is "text33"

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

And the name of the checkbox?

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

check box name "Add"

just so I am clear, I need to be able to do this on any page out of the 300 and so make a list

in "Text33" of all check boxes clicked.......say anything from 3 to 15 in the list...

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

You can't use the same field name for all the check-boxes. Each one will have to have a unique name.

Let's say that if "Add1" is ticked then "Text33" should show "Journey Planner".

You can use this code as the custom calculation script of Text33:

var items = [];

if (this.getField("Add1").valueAsString!="Off") items.push("Journey Planner");

if (this.getField("Add2").valueAsString!="Off") items.push("Something else");

if (this.getField("Add3").valueAsString!="Off") items.push("Yet another thing"); // etc.

event.value = items.join(", ");

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

OMG.... that is complicated.....

Just so i have this correct then...

I would have to have a different named check box on each page then

in text33 make a list of them as shown in your last message?

so basically a list of 300 different check boxes?

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

Well, if you place the text as the export value of each check-box then the script can be much simpler.

If you have fields named Add1 to Add300 you would only need to use this code:

var items = [];

for (var i=1; i<=300; i++) {

    var v = this.getField("Add"+i).valueAsString;

    if (v!="Off") items.push(v);

}

event.value = items.join(", ");

Regarding adding the check-boxes: That too can be done with a script, if they all need to appear on the same spot.

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

LATEST

ok thank you, I will give that a go tomoz..

will let you know if its worked.

many thanks again for your help

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

sorry...so what would be the script for each check box (Add1) on each page?

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 ,
Dec 05, 2018 Dec 05, 2018

Copy link to clipboard

Copied

The check-boxes themselves do not require having any script attached to them.

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