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

Change field value based on border color

Community Beginner ,
Dec 22, 2023 Dec 22, 2023

Hello,

 

I am working on a document for my company. There are some options that I want to directly correlate to another sheet. See attached screenshots.

 

The ideal scenario is:

If the user select "Cleaning System" on sheet 1, the border color will change to red. Once the border changes to red, the field value on sheet 3 will read "Yes". If the user deselects "Cleaning System" on sheet 1, the field value on the sheet 3 will read "N/A". I've done this before with check boxes, but not sure what the export values are for buttons. Any help is appreciated. Thank you!

TOPICS
How to , JavaScript , PDF , PDF forms
1.2K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Dec 22, 2023 Dec 22, 2023

Use this:

this.getField("Cleaning System Eng").value = (color.equal(color.red, event.target.strokeColor)) ? "Yes" : "N/A";

View solution in original post

Translate
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 22, 2023 Dec 22, 2023

Use this:

this.getField("Cleaning System Eng").value = (color.equal(color.red, event.target.strokeColor)) ? "Yes" : "N/A";

Translate
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 22, 2023 Dec 22, 2023

Just be aware the at the equal method is very finicky. It works well with the base colors, but as soon as you introduce fractions as the values of the color elements, it's likely to stop working correctly.

Translate
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 27, 2023 Dec 27, 2023
LATEST

This worked like a charm. Thank you so much!

 

@try67 Base colors should work fine for what I'm doing here. Thanks for the heads up!

 

Translate
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