Print Page | Close Window

Why won't my pulldown change colors

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.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=1455
Printed Date: 13 Dec 2019 at 2:22pm
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Why won't my pulldown change colors
Posted By: ibbob
Subject: Why won't my pulldown change colors
Date Posted: 21 Feb 2015 at 4:47pm
Ok, I thought this one was going to be simple....

My Script RUNS, without error, but nothing happens...

I have a pulldown box, with  6 options.  When you choose an option the FILLCOLOR is supposed to change depending on your choice.  I have the following in the "Custom Calculate" tab....  Console shows it runs, the right fields are reported, but nothing happens.

What am I missing???

{
console.println("Entering colortest switch routine");
  var incomming = event.target.value;
  var Field = event.target; 
  console.println(" Incomming value chosen was: "+incomming);
  console.println(" The field we are trying to color is: "+Field.name);

  switch (incomming)
  {
  case "NA" : 
        console.println(" NA");
        Field.fillcolor = color.black;
        break;
  case "Hazzard" : 
        console.println(" Hazzard");
        Field.fillcolor = color.red;
        break;
  case "Defective" : 
        console.println(" Defective");
        Field.fillcolor = color.black;
        break;
  case "Servicable" : 
        console.println(" Servicable");
        Field.fillcolor = color.black;
        break;
  case "Marginal" : 
        console.println(" Marginal");
        Field.fillcolor = color.orange;
        break;
  case "NI" : 
        console.println(" NI");
        Field.fillcolor = color.black;
        break;

  }
}

The colsole shows

Entering colortest switch routine
 Incomming value chosen was: Servicable
 The field we are trying to color is: SectionStatus  <<this is right !
 Servicable





Replies:
Posted By: ibbob
Date Posted: 21 Feb 2015 at 4:49pm
The console does show the changes (sorry) here is a sample run...

The Color never changes....

Entering colortest switch routine
 Incomming value chosen was: Servicable
 The field we are trying to color is: SectionStatus
 Servicable
Entering colortest switch routine
 Incomming value chosen was: Hazzard
 The field we are trying to color is: SectionStatus
 Hazzard
Entering colortest switch routine
 Incomming value chosen was: Marginal
 The field we are trying to color is: SectionStatus
 Marginal


Posted By: BAlheit
Date Posted: 22 Feb 2015 at 9:36am
The name of the property is fillColor not fillcolor.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net