Print Page | Close Window

Conditional Format

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
Printed Date: 17 Sep 2019 at 10:34pm
Software Version: Web Wiz Forums 11.10 -

Topic: Conditional Format
Posted By: alton.carroll05
Subject: Conditional Format
Date Posted: 19 Aug 2014 at 6:04pm
 am brand new to Java, so I this may be a simple fix and I just can't figure it out.

I am trying to change the fill color of a text box based on the selection of a radio button.


I have 4 radio button choices





and a text box that I would like to change fill color






if cent.grn is selected tf.assmnt.stat fill color = Green

if cent.amb is selected tf.assmnt.stat fill color = Orange

if is selected tf.assmnt.stat fill color = Red

if cent.blk is selected tf.assmnt.stat fill color = Black


Thanks in advance


Posted By: gkaiseril
Date Posted: 19 Aug 2014 at 6:54pm
Acrobat forms use a variation of JavaScript and not the computer programing language Java.

Are the radio buttons in an exclusionary group with unique export values? 

Then test the value of the group. When there is no selection the value is the string "Off".
Assuming the optional value for the selected button is the color name.
// the custom calculation script for the text field tf.assmnt.stat;
// make desion on value of radio button group;
switch(this.getField("cent").value.toLowerCase()) {
case "black" : =;
case "green" : =;
case "orange" : = ["CMYK", 0, .62, 1, 0];
case "red" : =;
// all other seelctions; = color.transparent;
} // end switch radio button;


Posted By: aandi
Date Posted: 19 Aug 2014 at 7:00pm
Not an answer but a note. It isn't Java. It's JavaScript. This matters a lot because if you search the web for information on Java, you'll get a load of stuff that doesn't help but looks as if it might, because Java exists, looks similar, and is actually very different....

Posted By: alton.carroll05
Date Posted: 19 Aug 2014 at 9:39pm
Thanks alot....and the semantics makes since that my web searches gives me content that is close, but still confusing.

Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 -
Copyright ©2001-2017 Web Wiz Ltd. -