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

Conditional formatting of cell's fill based on text value

New Here ,
Nov 01, 2019 Nov 01, 2019

Copy link to clipboard

Copied

Hi, I am sure the answer is out there and have probably missed it. 

I have created a form in indesign, exported it as interactive pdf. One of the cells (Deficiency) has a drop down list with options Yes/No/ N/A. I would like the fill colour of the box and its two adjacent cells to change to Red wherever the deficiency option is YES. Is this condition possible (either in Acrobat or even Indesign) with text values or does it only work with numeric values? It's the first time I am using javascripts so I am pretty uncertain what to change in the codes I found which could potentially offer the solution. Screenshot of form attached. Much appreciate any help or suggestions- thank you! 

 

Conditional Formatting-Acrobat Forms.JPG

TOPICS
Acrobat SDK and JavaScript

Views

2.8K

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

Community Expert , Nov 01, 2019 Nov 01, 2019

Yes, it's possible, with any kind of value. Use this code as the custom Validation script of the drop-down field (make sure to tick the box to commit the selected value immediately, under the field's Properties, Options tab):

 

if (event.value=="Yes") {
	event.target.fillColor = color.red;
	this.getField("Action/Date").fillColor = color.red;
	this.getField("Owner/A1").fillColor = color.red;
} else {
	event.target.fillColor = color.white;
	this.getField("Action/Date").fillColor = color.white;
	th
...

Votes

Translate

Translate
Community Expert ,
Nov 01, 2019 Nov 01, 2019

Copy link to clipboard

Copied

Yes, it's possible, with any kind of value. Use this code as the custom Validation script of the drop-down field (make sure to tick the box to commit the selected value immediately, under the field's Properties, Options tab):

 

if (event.value=="Yes") {
	event.target.fillColor = color.red;
	this.getField("Action/Date").fillColor = color.red;
	this.getField("Owner/A1").fillColor = color.red;
} else {
	event.target.fillColor = color.white;
	this.getField("Action/Date").fillColor = color.white;
	this.getField("Owner/A1").fillColor = color.white;
}

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
New Here ,
Nov 04, 2019 Nov 04, 2019

Copy link to clipboard

Copied

LATEST

Thank you so so much!! It worked like a charm - much appreciated! 

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