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

Change the color of a connected line comment with a checkbox

Community Beginner ,
Apr 07, 2022 Apr 07, 2022

Copy link to clipboard

Copied

Hello everyone,

 

Im currently discovering adobe acrobate and i encounter some difficulties. I'm working on a railroad map with stations(represented as checkboxes) and segments between the stations. I used the comment option to draw segments of my network on my map, with connected lines. The aim of my work is to show wich segment is in maintenance and wich are still available.I  put checkboxes between each segments. When a checkbox is checked i want the segment before the checked box to be colored as green and if the box is not checked or unchecked the segment color is set to red.i put an example of the map and what i need (i made it manually but i need it to be automatic).

 

The probleme, I dont know how can I change the color of the colored line by checking the box and I don't find so much stuff that suit well my problem.

 

Thank you in advance

Nelson

 

TOPICS
Create PDFs , General troubleshooting , How to , JavaScript , PDF forms , Standards and accessibility

Views

620

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 , Apr 07, 2022 Apr 07, 2022

At checkbox properties->Action->MouseUp->Run Javascript add this code:
this.getAnnot(0,"Your annot name goes here").strokeColor = event.target.value == "Off" ? color.red : color.green;


To find your annot(drawing) name, select your annot and press CTRL+J
now in console window that pop paste this code:
this.selectedAnnots[0].name;
and press Enter to get name, now copy that name and put it into code where says "Your annot name goes here".

Votes

Translate

Translate
Community Expert , Apr 08, 2022 Apr 08, 2022

In the console window select the whole script and press ctrl + enter.

Votes

Translate

Translate
Community Expert ,
Apr 07, 2022 Apr 07, 2022

Copy link to clipboard

Copied

At checkbox properties->Action->MouseUp->Run Javascript add this code:
this.getAnnot(0,"Your annot name goes here").strokeColor = event.target.value == "Off" ? color.red : color.green;


To find your annot(drawing) name, select your annot and press CTRL+J
now in console window that pop paste this code:
this.selectedAnnots[0].name;
and press Enter to get name, now copy that name and put it into code where says "Your annot name goes here".

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 ,
Apr 08, 2022 Apr 08, 2022

Copy link to clipboard

Copied

Thanks a lot i think this might work but i encountered a litle problem in the window wich pop when ctrl + j on my annot i can't paste the code or write anything in the javascript section is that normal ?When i put the code on the console window and press enter nothong happens 😕

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 08, 2022 Apr 08, 2022

Copy link to clipboard

Copied

In the console window select the whole script and press ctrl + enter.

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 ,
Apr 08, 2022 Apr 08, 2022

Copy link to clipboard

Copied

LATEST

Thanks it work !!!

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