Change the background color of a table cell, depending on the selection in a drop-down list

I have a drop-down list wrapped in a subform in a table cell. Users can choose green, yellow or red, and I want the background color to change according to their choice.

Can you tell me why this script does not work? I'm sure that some of you, dear friends can see in a second.


If (this. ListItem == "green") {}

Subform1.DropDownList1.fillColor = "000,128,000"; BackgroundFill = "solid";

}

If (this. ListItem == 'yellow') {}

Subform1.DropDownList1.fillColor = "255,128,000";

}

If (this. ListItem == 'red') {}

Subform1.DropDownList1.fillColor = "255,000,000;

}


Thank you

Hello

I think you should be able to use the following code in the event change of the dropdownlist control.

Form1. #subform [0]. Table1.row2.DropDownList1::change - (JavaScript, client)

If {(xfa.event.change=="green)"}

this.fillColor = "000,128,000";

}

If {(xfa.event.change=="yellow)"}

this.fillColor = "255,128,000";

}

If {(xfa.event.change=="red)"}

this.fillColor = "255,000,000;

}

Concerning

Bruce

Tags: Adobe LiveCycle

Similar Questions

  • If statement to change the items in a drop-down list

    Is there a way to change the options in a drop-down list in a script (without data binding)? So I have a drop down list and depending on what the user selects the second drop-down list will have different options. These elements can be specified by an if statement in the preOpen the second dropdown list event? The form will be filled out offline, so I don't want to put a link of data binding.

    Thank you!

    Hello

    There are at least two ways, as shown in http://forums.adobe.com/message/4321707#4321707.  Basically clearItems/addItem if pre Reader 9.0 or setItems supported if you use Reader 9.0 or later.

    Bruce

  • How to change the items in a drop-down list box that is part of an array of clusters

    Hello

    In the attached vi, I have an array of clusters and each cluster contains two drop-down list boxes. How can I edit the items in the drop-down list box 1 for all elements in the array? (All elements of list box 1 has the same elements.)

    By way of illustration, I have also included the case of trivila, for example, edit the items in a separate drop-down list box that is is not part of an array of clusters (combo box 3). Please notify. Thank you.

    Peter

    Right click on the drop-down list box and select Create-> Node-> String() property. Place it on the block diagram. Change to write (right click) and then feed him an array of strings.

  • Change the caption of a drop-down list field

    Hi all

    I'm changing the legend of some field drop-down under certain conditions. The following is written on some other field drop-down list:

    If (this.rawValue == 'Ad Hoc payments')

    {    

    xfa.resolveNode ("form. PaymentDetails.ddlInvoiceFrequency.caption #text ") .rawValue group"TEST CAPTION";

    }

    But it seems to not work.

    Any help would be much appreciated.

    Thank you

    Vijay.

    Try with this:

    delete the caption in the palette of the subject field and type this in the case of change:

    If (xfa.event.newText is "Ad Hoc payments") this.caption.value.text.value = "TEST CAPTION";

  • UI - how to make columns in the selection on a Drop Down list?

    I change a code from Peter Kahrel "start Script UI. I'm trying to make a searchable dropdown list has 4 columns. Research so far and I have positions in research, but I can't seem to make the columns for actual data. I think I need to change the type_ahead as the table is looking at these data. I'm stuck in the water. Can someone tell me what I need to do to get the list is displayed as a column? How can I activate the chosen = type_ahead given in four columns? Code and screenshot below:

    Window Capture.jpg

    picked = type_ahead (["bat", "bear", "beaver", "bee", "cat", "cats_and_dogs",
    "dog", "maggot", "moose", "moth", "mouse"]);
    
    function type_ahead (array)
    {
    var w = new Window ("dialog", "Quick select");
    var entry = w.add ("edittext", [0, 0, 800, 22]);
    entry.active = true;
    
    var list = w.add ("listbox",  [0, 0,800, 500], "",
    {numberOfColumns: 4, showHeaders: true,
    columnTitles: ["Non-Approved Word", "Approved Alternative", "Approved Use", "Non-Approved Use"], columnWidths: [200,200,200,200]});
    
    list.selection = 0;
    
    entry.onChanging = function ()
    {
    var temp = this.text;
    list.removeAll ();
    for (var i = 0; i < array.length; i++)
    if (array[i].toLowerCase().indexOf (temp) == 0)
    list.add ("item", array[i]);
    if (list.items.length > 0)
    list.selection = 0;
    }
    entry.onChange = function () {w.close (1)}
    if (w.show () != 2)
    return list.selection.text;
    else
    
    w.close ();
    }
    

    Yes, you can do as a palette, but you will have to change two things.

    1. target engine. At the beginning of the script, add the following:

    #targetengine "session."

    2. you may not use this code:

    If (w.show ()! = 2)
    Return list.selection.text;
    on the other
    w.Close ();

    Just use w.show (). You then add a control that, when clicked, determine what you want to do. For example, add a "Stop" button and a Manager in this sense:

    stopButton.onClick = function)

    {

    to do this

    Update

    w.Close ();

    }

    Peter

  • Cannot save the selection in a drop-down list

    Hi, I originally posted this in the section of the'Acrobat Windows but said to post it here instead.

    I created a snazzy form in Adobe Designer 7.0.  This form had drop-down boxes with 3 or 4 selections in them.

    When I open AA 7 Pro and fill out the form, it will not save the menu drop-down entries in the box.

    For example:

    A field is just a text input, so I'll enter '20 000 '.  The following field has 3 selections "Diesel, gasoline, kerosene." I will select Diesel.

    I save, close and reopen this case.

    The "20 000" will be there, but it will not save the 'Diesel '.

    So, what gives?  Is it me?

    Take a look at the bindinng of the fields tab does not appear, and make sure that they are NOT set to None. Watch another

    field that is saved. He was normal? If set all the fields that you want saved to normal.

    Paul

  • Populate a drop-down list based on selected in a drop-down list in a separate table

    Good day all.

    This may seem a simple question for most, but... He had me frustrated trying to figure out.

    I'm trying to fill in a drop-down list that is based on what is selected in another drop-down list.

    Let me explain what I've done so far.

    Life cycle of Designer 8.05.2

    When I got the two drop-down lists in the same table, I've not had a problem. The code I used is

    The table name is "table1".

    if (directorate.rawValue == '1')

    {

    division.clearItems ();

    division.addItem ("select" "")

    }

    I was asked to move things and now 'division' is located in 'Table2 '.

    I know that I need the "Table1" reference, but I'm running into a syntax error. I tried the following code;

    if (Table1 Row1 directorate.rawValue == '1')

    {

    division.clearItems ();

    division.addItem ("make a choice")

    }

    if (Table1.Row1.directorate.rawValue == '1')

    {

    division.clearItems ();

    division.addItem ("make a choice")

    }

    Any help would be appreciated

    Chomp

    You are missing a semicolon at the end of the line, addItem, and the second code example, you have no periods in the SOM (Table1 Row1 direction) reference.

    The best way to get the path to another field is to ctrl-click on the ground while you are in the script editor.

  • Populate drop-down list with the results of several drop-down lists

    Hi, I am creating a form where the results of two drop-down lists then would fill another drop-down list. I'm not new to javascript, but I'm new to using it in Acrobat, so while I found some answers to this: Drop-down list fill in multiple fields of text. I don't know where to implement this, if it is still the right thing, I'm looking for pipes for

    Oh and I use Acrobat Pro DC. Any help would be much appreciated!

    OK, you can create a function at the level of the document that is called in the Validate event of each of the two first drop down menus, something like:

    Function in JavaScript to the document level

    function updateDropdown() {}

    Get references to the drop-down menus of entry

    var F1 = getField ("DropdownList1");

    var F2 = getField ("DropdownList2");

    Refer to the output drop-down list

    F3 var = getField ("DropdownList3");

    Get the values of input field, as strings

    var s1 = event.target = f1? Event.value: f1.valueAsString;

    var s2 = event.target = f2? Event.value: f2.valueAsString;

    Fill the drop-down list of output with the elements, or deselect it if either input dropdown is 'empty' (single topic area)

    If (s1 = "" |) s2 === " ") {

    F3.clearItems ();

    } else {}

    F3.setItems (["", s1, s2]);

    }

    }

    In the two first downs Validate event, call this function like this:

    updateDropdown();

    You can of course name the function you want. More information about the properties and the methods used in the code are available in the Acrobat JavaScript documentation.

  • Download the news of a drop-down list for a field of text box

    Its that simple! That's all I need to know! The code to add to the information in a drop-down list (_cb) to a text field. I need to know wear put on the script IE in the action on the _cb layer. Your all!

    on the timeline that contains your combobox with instance name _cb that you can use:

  • change the background color of specific table cell

    Hello

    I'm trying to highlight the cell when the max value occurs in the attached VI.

    In addition, as it is a secondary function, possible to change the background color of this specific cell?

    Thank you

    hiNi

    This?

  • Customize the Format of text, drop-down lists

    Hey all,.

    I have problems of customization of the top botton label of a water drop down. I can customize cell converters labels, but the top label is not affected and is always Times New Roman... Any ideas what I'm missing here?

    Here is a screenshot:

    Here's my CellRenderer customized for the drop down:

    public class CustomDropDownCellRenderer extends DropDownCellRenderer
        {
            public function CustomDropDownCellRenderer()
            {
                super();
            }
    
            override protected function init():void{
    
                var format:TextFormat=new TextFormat();
                format.font="font_helveticaNeue";
                format.size=16;
                format.color=0x000000;
    
                super.init();
    
                setTextFormatForState(format, SkinStates.DISABLED);
                setTextFormatForState(format, SkinStates.UP);
                setTextFormatForState(format, SkinStates.DOWN);
                setTextFormatForState(format, SkinStates.SELECTED);
                setTextFormatForState(format, SkinStates.DISABLED_SELECTED);
                this.label.label_txt.embedFonts=true;
            }
        }
    

    Here's where I put the drop down skin:

    brushDropDown=new DropDown();           brushDropDown.setListSkin(CustomDropDownCellRenderer);
    brushDropDown.setButtonSkin(CustomDropDownButtonSkin);          brushDropDown.addEventListener(Event.SELECT, brushDropDownEventHandler);
    brushDropDown.dataProvider=brushShapes;
    

    I thought I might have to customize the DropDownButtonSkin, but this class does not have a label...

    Any help would be appreciated.

    Hey,.

    I've done some research more and similarly to another thread involving the selector, the own only cut the way to do it is by creating a class sup from the drop-down list. However, this one is kind of weird. Once again, with assistance from flash builder, I could see the protected class drop-down list properties and the objective here is the purpose of __button. now the weird part is that its type is a DropDownButton. they took that as an accessible API since the new update. but I managed to make some changes anyway.

    so the solution, create a void called CustomDropDown class that extends the class from the drop-down list. After that, in the constuctor, use the this.__button.getTextFormatForState () method to manipulate the textformat of the button. Here is an example:

    ListTests.as:

    package{   import flash.display.Sprite;  import flash.display.StageAlign;  import flash.display.StageScaleMode;
    
      import qnx.ui.data.DataProvider;  import qnx.ui.listClasses.DropDown;   import qnx.ui.listClasses.List;
    
      [SWF(width="1024",height="600",backgroundColor="#E8E8E8",frameRate="30")] public class ListTests extends Sprite {     private var myList:CustomDropDown;       private var myDataProvider:DataProvider;      private var myArray:Array;
    
          public function ListTests()       {         super();
    
              // support autoOrients            stage.align = StageAlign.TOP_LEFT;            stage.scaleMode = StageScaleMode.NO_SCALE;
    
              myList = new CustomDropDown();           myArray = new Array();
    
              myArray.push({label: "Thomas Luddington"});           myArray.push({label: "Master Maruyn"});           myArray.push({label: "Master Gardyner"});         myArray.push({label: "Captain Vaughan"});         myArray.push({label: "Master Kendall"});          myArray.push({label: "Master Prideox"});          myArray.push({label: "Robert Holecroft"});            myArray.push({label: "Rise Courtenay"});          myArray.push({label: "Master Hugh Rogers"});          myArray.push({label: "Thomas Foxe"});         myArray.push({label: "Edward Nugen"});            myArray.push({label: "Darby Glande"});            myArray.push({label: "Edward Kelle"});            myArray.push({label: "Iohn Gostigo"});            myArray.push({label: "Erasmus Clefs"});           myArray.push({label: "Edward Ketcheman"});            myArray.push({label: "Iohn Linsey"});         myArray.push({label: "Thomas Rottenbury"});           myArray.push({label: "Roger Deane"});         myArray.push({label: "Iohn Harris"});
    
              myDataProvider = new DataProvider(myArray);
    
              myList.dataProvider = myDataProvider;
    
              myList.setPosition(10,10);            myList.width = 300;
    
              addChild(myList);
    
          } }}
    

    CustomDropDown.as:

    package{   import qnx.ui.listClasses.DropDown;   import qnx.ui.skins.SkinStates;
    
      public class CustomDropDown extends DropDown {     public function CustomDropDown()      {         super();
    
              this.__button.getTextFormatForState(SkinStates.UP).font = "Comic Sans MS";            this.__button.getTextFormatForState(SkinStates.SELECTED).font = "Comic Sans MS";          this.__button.getTextFormatForState(SkinStates.DOWN).font = "Comic Sans MS";          this.__button.getTextFormatForState(SkinStates.DOWN_SELECTED).font = "Comic Sans MS";                  } }}
    

    And Yes, clearly I'm a fan of Comic-who isn't?

    Yet once, it is going to work identical to the drop-down list but instead allows you to set your own font. in fact, you can create a new method which is what I did in the above code, so you can change the font on the fly without having to make five different subclasses just to change the textformat! hope that helps. Good luck!

  • Make a visible selection during the withdrawal in a drop-down list

    Good day all.

    I am putting together a form where I have a drop-down list that contains 3 choices. When one of these choices is selected in the drop-down list, a table becomes visible to the user to fill out.

    The question I have is when the user selects in the drop-down menu, the table is not visible unless the user clicks in the fall down once again.

    I tried an event ' click and exit "and came with the same question.

    Here is the code I use. I would appreciate help with this.

    Chomp

    if (this.rawValue == '5') { }

    term_select. Presence = 'visible';

    }

    if (this.rawValue ! = '5') { }

    term_select. Presence = 'hidden';

    }

    if (this.rawValue == '6') { }

    temp_select. Presence = 'visible';

    }

    if (this.rawValue ! = '6') { }

    temp_select. Presence = 'hidden';

    }

    if (this.rawValue == '7') { }

    act_select. Presence = 'visible';

    }

    if (this.rawValue ! = '7') { }

    act_select. Presence = 'hidden';

    }

    You must use xfa.event.newText to get the selected value.

    The change event:

    var newValue = this.boundItem(xfa.event.newText);
    
    if (newValue == "5") {
        term_select.presence = "visible";
    }
    
    //etc.
    
  • Where is the past, bookmark button that displays all THE bookmarks as a drop-down list?

    I had to reinstall my OS, and now I don't see the big 'Favorites' button, I got to the right of the search box Google with Firefox.
    It is with the value 'Icons' of icons.
    I use to be able to click on "Favorites" and they appear in a drop-down list, like 'latest news' power works.
    I can click the Favorites (with the star on this subject), who comes here to open a sidebar - not a menu drop-down which disappears when I clicked it.

    I loaded Windows 7 and took some quick screenshots for you:
    http://tinyurl.com/3c7ouvs

    Also note that it only shows the bookmarks menu button if you use the Firefox menu button and not the classic menu bar, because it would be quite redundant to have a button and the bookmarks at the top menu which does exactly the same thing.

    Look at what you have in the toolbar and what is in the window customize (you may need to scroll down). If you have one in the toolbar then the other is probably in the window customize somewhere. If you have a lot of addons installed there may be many buttons to look through.

    If you have problems you can just click on the 'Restore Default Set' button in the Customize dialog box to restore the default values that will also involve of the bookmarks that you want to switch all your toolbars. If you had any other customizations to your toolbars and then change them back again.

  • drop-down lists on the forms don't drop-down list

    I use Firefox 3.6.16 on Mandriva 2010.2 and for the last two months, the drop-down lists don't dropdown. I thought a patch would come out to fix it or it would be one of my modules cause. There was an update recently and it has not fixed. Today, I've disabled all addons and restarted, but still it does not allow me to make a choice with the mouse.

    There are many similar problems with FF4, but none of the solutions appear to be relevant.

    Anyone got any suggestions?

    < edit > I just disabled all the plugins too but still the same. What I noticed at the time, is that there seem to be two versions of Flash installed, but only the first shows under tools modules Plugins

    There is no need to create a new thread. You can edit your first post and change the title, if you want to change it or I can do it if you post a better title.

    Problems with a menu drop-down does not not can be caused by an extension.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Tools > Modules > appearance/themes).

    See:

    If this does not work in mode without failure, then disable all extensions and then try to find out who is the cause by allowing both the problem reappears.

    • Choose "Disable all add-ons" on issues to troubleshoot Firefox in Safe Mode to set window to disable all extensions.
    • Close and restart Firefox after each change through "file > exit ' (Mac: ' Firefox > leave";) Linux: "file > exit ')
  • Modification of the properties-type def drop-down list box

    I have a group of 32 cases of a def type. The def type contains several different types of control. What I have to do is to change the properties of the list box for each of the type defs. Normally, I would create an array of references to change the properties for each of the type defs, but when I try this I can not access the properties of string [] for combo box selections. The only way I found to fix it is to create a reference for each individual drop-down list box item. It is labour, since I'll have 32 elements. Is there a way to beeter to do this? The first screenshot shows the issui I'll have, not being able to change the properties of specific elements within each of the def type at runtime through a control [] array. The second screenshot shows the only solution I've found so far, which is not very practical.

    You will need to set up (for a more specific class) control to a type of combo box for the particular control [] index that has the combobox control if you want to access the drop-down list.

    You can also access the combobox in a cluster based directly, rigth click on the control reference and a link to the element cluster directly.

    The last option is to make the strictt of typdef will fill all instances with the channel list [] given that it is a strict property.

    the approach is based on the weather, you plan on changing the list during execution.

Maybe you are looking for