Script to include a background color change depends on the answer

I previously got help from a user here to create a script that autopopulates field based on the options selected in two sets of radio buttons:

var result = this.getField("Consequence").valueAsString;

probability of var = this.getField("Likelihood").valueAsString;

If (result == 'Negligible' & & probability == 'Rare') event.value = "Low";

Else if (result == 'Negligible' & & probability == 'Unlikely') event.value = "Low";

ElseIf (result == 'Negligible' & & probability == 'Moderate') event.value = "Low";

Else if (result == 'Negligible' & & probability == 'Probably') event.value = "Low";

ElseIf (result == 'Negligible' & & probability == "almost certain") event.value = "moderate."

Else if (result == 'Minor' & & probability == 'Rare') event.value = "Low";

Else if (result == 'Minor' & & probability == 'Unlikely') event.value = "Low";

ElseIf (result == 'Minor' & & probability == 'Moderate') event.value = "moderate."

ElseIf (result == 'Minor' & & probability == 'Probably') event.value = "moderate."

Else if (result == 'Minor' & & probability == "almost certain") event.value = "high";

Else if (result == 'Moderate' & & probability == 'Rare') event.value = "Low";

ElseIf (result == 'Moderate' & & probability == 'Unlikely') event.value = "moderate."

ElseIf (result == 'Moderate' & & probability == 'Moderate') event.value = "high";

ElseIf (result == 'Moderate' & & probability == 'Probably') event.value = "high";

Else if (result == 'Moderate' & & probability == "almost certain") event.value = "critical";

Else if (result == "Major" & & probability == 'Rare') event.value = "Low";

ElseIf (result == "Major" & & probability == 'Unlikely') event.value = "moderate."

ElseIf (result == "Major" & & probability == 'Moderate') event.value = "high";

Else if (result == "Major" & & probability == 'Probably') event.value = "critical";

ElseIf (result == "Major" & & probability == "almost certain") event.value = "Extreme";

ElseIf (result == "Catastrophic" & & probability == 'Rare') event.value = "moderate."

Else if (result == "Catastrophic" & & probability == 'Unlikely') event.value = "high";

Else if (result == "Catastrophic" & & probability == "Moderate") event.value = "critical";

ElseIf (result == "Catastrophic" & & probability == 'Probably') event.value = "Extreme";

ElseIf (result == "Catastrophic" & & probability == "almost certain") event.value = "Extreme";

etc.

else event.value = "";

I wonder if its possible to have the color of the field that uses the script above, change based on the input. For example if the response is weak; make the background color green. If its moderate, make orange etc. ?

I know it of asking a big but thought I would check.

Thanks in advance.

Of course, it is possible. Add at the end of your code:

if (event.value=="Low") event.target.fillColor = color.green;
else if (event.value=="Moderate") event.target.fillColor = ["RGB", 1, 0.5, 0]; // = Orange
else if (event.value=="High") event.target.fillColor = color.red;
// etc.
else event.target.fillColor = color.white;

Tags: Acrobat

Similar Questions

  • Background color changes when you save a theme

    Just did a new install of Windows 7 Home Premium and has found that, when I save a theme, the background color changes from black (what it was worth) to white. Another thing to note is that when I save the generic theme "Custom Theme" (meaning an unsaved theme) remains, and the background color in the registered theme is changed and does not change when I click on the "custom theme". This is a new installation, so the only software that has been installed is video drivers, network cards drivers, the drivers of the antivirus and sounds. I've used the System File Checker, and he found no problem.

    Hello

    I recommend that you follow the steps from the link below and check if it helps.

    Create a theme

    http://Windows.Microsoft.com/en-us/Windows7/create-a-theme

    Hope this information helps.

  • I finally got CS2 installed on my system. But now the menu background color is black and the elements are not visible until the cursor is over them. It is very difficult to read. How can I change this?

    I finally got CS2 installed on my system. But now the drop-menu background color is black and the elements are not visible until the cursor is over them. It is very difficult to read. How can I change this? I tried to go into change preferences but it does not work

    I changed it to the value default them and that worked. Thank you very much

  • How to change the background color of selection of the selected item in the drop-down box of choice?

    How to change the background color of selection of the selected item in the drop-down box of choice?

    By default, the selection background color like 'blue', but if I want it to be "yellow" for example, how should I do?

    Thank you

    The id is applied by (I think) the skin of the ChoiceBox class. You don't need to define.

    You must apply the css in an external style sheet. You can apply the external style sheet to any parent of the box of your choice, or on-site (the most usual way to do it).

    Example:

    import java.util.ArrayList;
    import java.util.List;
    
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    
    public class ChoiceBoxTest extends Application {
    
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
    
        final ChoiceBox choiceBox = new ChoiceBox<>();
    
        List tempResult = new ArrayList();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        }
        choiceBox.getItems().setAll(tempResult);
    
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();
      }
    
      public static void main(String[] args) {
        launch(args);
      }
    
    }
    

    choiceBox.css:

    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
     -fx-background-color: yellow ;
    }
    #choice-box-menu-item .label {
     -fx-text-fill: black ;
    }
    

    Post edited by: James_D

  • Is there a way to make the background color of a check box change depending on the State, in that it is?

    As: Green background when checked and white background (neutral), while not controlled.  Management wants to draw attention to areas that have been selected.

    If you create a script by right-clicking form1 object in your hierarchy (which is the subform above) and click on create a Script object and then insert into the function below script object:

    function changeColor (rootObject) {/ /}<--Refers to="" the="" object="" itself="">

    If (rootObject.rawValue! = null: rootObject.rawValue! = 0) {}

    rootObject.border.fill.presence = 'hidden ';

    } else {}

    rootObject.border.fill.presence = "visible";

    }

    }

    From there the Action Builder, you can use 'A Script object function call' then choose your item and choose the function changeColor. This should do the trick for you. This will show or hide the background color of your field.

    If you want to change the color instead of hide or show, you can use this function at the bottom and change the RGB value to your liking:

    function changeColor (rootObject) {/ /}<--Refers to="" the="" object="" itself="">

    If (rootObject.rawValue! = null: rootObject.rawValue! = 0) {}

    rootObject.border.fill.color.value = "255,255,255"; 255,255,255 represents white, no colour

    } else {}

    rootObject.border.fill.presence = "0,255,64";

    }

    }

  • Background color change in Bootstrap

    Hello... New to Dreamweaver bootstrap...

    I used the basic navigation bar and want to change the background color of the drop point clicked once. Anyone know?

    Thanks in advance.

    To customize the default bootstrap navigation bar styles, use this online generator.

    Bootstrap Menu Builder | Bootstrap Navbar Builder | Design tools "bootstrap".

    Nancy O.

  • Background color change

    I have photoshop 'play money' files the customer who wants me to change the background color "off-white"... the PSD file has got a ton of subtle creamy tones to it throughout of... Is it possible to replace these "creamy" tones with another broken white color, almost a very light Tan? He got very subtle pixels pixels of color, gray environment background cream otherwise all around the top left & right corners fig leaves, etc. I have attached a pix of the front of the fictitious money.

    Realistic Mat Money 2015.jpg

    not quite sure what you're trying to do, but try to use this transparent PNG. He will need alterations in places. As I can't see the subtle details that you're talking about I can't really tell if it works. Basically, put a layer of background tan colored behind this image to color the background.

  • Flash CS5 how do a background color change component TextArea

    I'm trying to change the background color of a TextArea component.  Does anyone know how to do this?

    function processXML(e:Event):void {}
    var strTextBox:String;
    myText.visible = true;
    myText.setStyle ("contentBackgroundColor", 0x000000);  Fact does not work... not myText.setStyle("backgroundColor",0x000000);
    myXML = new XML (e.target.data);
    strTextBox = "< a href =" "" + myXML.Branch [0] .linkURL + ' "> more info... < /a >". "
    myText.htmlText = strTextBox;
    }

    Try:

    function processXML(e:Event):void {}
    var strTextBox:String;
    myText.visible = true;
    myText.textField.background = true;

    myText.textField.backgroundColor = 0 x 000000;

    myXML = new XML (e.target.data);
    strTextBox = ' more info...';
    myText.htmlText = strTextBox;
    }

  • Number of the color changing when moving the pipette around the outline color or background

    When I move my pipette above and move around to a United of contour or background color in the tool bar, window properties and color mixer, I have different web color numbers. Why is this? Flash never used to do (I use Flash Professional 8.0) and of all rights should not (since the color is vector).

    See

    http://img.Photobucket.com/albums/V292/pancreasboy/Misc/colour1.jpg

    and

    http://img.Photobucket.com/albums/V292/pancreasboy/Misc/colour2.jpg

    All rights should not change the number of color, but it changes from B53110 to BD3110, now this may seem insignificant, but it can sometimes be really sensitive, and especially if I continue to use the eyedropper again and again to get the color once again.

    Guess what it was in the end?

    I have 2 monitors of mac, one has been updated with the "Studio Display 21" and the other to the 'Studio Display 21 calibrated' and for some reason that it is perform once chosen Flash color values

    so I fixed them both the same settings and all about hunky dorry!

    Thanks for the trouble, y ' All!

    (although SHIFT-option duplicate drag still does not work, but it's getting sent in another topic)

  • CNC - text and background color changes when you use the inc/dec

    Hello

    I develop an application that has a sign with a black background and green or red numbers. I have added digital controls and set the text color and text background color attributes accordinglingy. I put the control digital hot or validate command mode and display the arrows of inc/dec, because I want to incr/Decr numbers.

    The problem is that when I run the app and I hit arrows inc/dec, then the colors inside the scope of digital control become reversed: black background becomes white and cyan green number. I created an assosicated callback with digital control and tried to force the text color and the background, in the EVENT_VAL_CHANGED section, by using the SetCtrlAttrribute() function, but nothing helped. Also added ProcessDrawEvents did not help.

    When I mouse click again outside the digital command, then it returns to its original colours (green, black text background).

    Suggestions as to how can I fix?

    I want it keeps its original colors at all times, even when I am clicking on the arrows incr/Decr...

    Kind regards

    pgriep

    Hello Roberto,

    I thought it would be another way to fix it. Just hoped that I could fix it in setting or by disabling an attribute.

    Thanks for the effort!

    See you soon,.

    pgriep

  • Why foreground/background colors change when I switch to quick mask? I can't stop this change?

    I click on------, and the foreground/background colors switch. Why? How can I control this behavior of Photoshop?

    It would be simpler for my workflow of Photoshop that I knew what I was using the color.

    Hello

    In quick mask mode Photoshop automatically default gray scale, with a background of black and white, background color color mode. When you use a painting or the tool in quick mask editing mode, keep these principles in mind:

    • With black paint adds to the mask (the Red overlay) and decreases the selected area.
    • Painting with white clears the mask (the Red overlay) and increases the selected area.
    • Gray paint partially added to the mask.

    Thank you

  • You can change the background color of canvas in the iOS app Preview?

    If my drawing is smaller than my camera, I still see a gray background for the area outside of the design or the artboard.  I want a different background color in more gray.

    Photoshop supports different colors of background for work plans, but the Preview CC iOS app does not.  The backdrop will still look gray in the iOS app.  Support background colors in the iOS app is something that we will consider for a future version.  If you want to see this support, please e-mail us at [email protected].

  • Hover content table, background color change

    How can I achieve this effect of hover background color? As the table on this page:

    http://UConn.edu/holiday/teams.html

    jr4292 wrote:

    Yes, but these are not links.

    Well in this case it is even easier by using this code:

    {TD:hover}

    background: #73D5FC;

    }

    Good luck.

  • Why is the background color changes?

    Hello world...

    I have a problem: when I insert an external .swf in my current state, its background color is similar to that of the current Stadium. Why?

    Please, help me.

    Emiliano.

    This is because it is in fact no background inside Flass. Which area (stage) you placed your articles on color is just there to help you see them.

    For your problem, simply place a rectangle colored on the bottom most layer and you will be good.

  • Alternate the background color on and off the toolbar

    Hello

    I have a request. I use Firefox regularly and change the background color in the "content" of the preferences section is easier on my eyes. However, on some sites I would like to disable this function, but I have to go to the preferences it off and then turn it back on once I have leave the site.

    Is it possible for you to make a button that can enable this setting and disable the toolbar? That way if I need to see pictures on a site I can click on the button and then click again to turn it off.

    Kind Regards,
    Bobby
    

    See if this extension - https://addons.mozilla.org/en-US/firefox/addon/toolbar-buttons/ - has the functionality you need.
    Support forum for this extension is here - in case you need to do a custom for your function button:
    https://codefisher.org/Forum/2/

Maybe you are looking for