Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - Conditional Format
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

Conditional Format

 Post Reply Post Reply
Author
alton.carroll05 View Drop Down
New Member
New Member
Avatar

Joined: 19 Aug 2014
Location: United States
Points: 2
Post Options Post Options   Quote alton.carroll05 Quote  Post ReplyReply Direct Link To This Post Topic: Conditional Format
    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

cent.grn

cent.amb

cent.red

cent.blk

 

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

 

tf.assmnt.stat

 

So...

 

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

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

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

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

 

Thanks in advance

Al

Back to Top
Sponsored Links


Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4107
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post 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" :
event.target.fillColor = color.black;
break;
case "green" :
event.target.fillColor = color.green;
break;
case "orange" :
event.target.fillColor = ["CMYK", 0, .62, 1, 0];
break;
case "red" :
event.target.fillColor = color.red;
break;
default:
// all other seelctions;
event.target.fillColor = color.transparent;
break;
} // end switch radio button;

 
 


Edited by gkaiseril - 19 Aug 2014 at 7:20pm
Back to Top
aandi View Drop Down
Senior Member
Senior Member


Joined: 07 Jul 2011
Points: 18358
Post Options Post Options   Quote aandi Quote  Post ReplyReply Direct Link To This Post 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....
Back to Top
alton.carroll05 View Drop Down
New Member
New Member
Avatar

Joined: 19 Aug 2014
Location: United States
Points: 2
Post Options Post Options   Quote alton.carroll05 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

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

This page was generated in 0.047 seconds.