Changing field text color and fill based on input value.

I am trying to create a field that can be red, yellow or green.  In the end, what I need is a box that can be made red, yellow or green by the form user.  My strategy is to use a validation script to change the field and text color based on the field input.  So if you type "red", the text and field turn red, essentially making a red box.  The field is named "GoalColor".
Am I headed in the right direction to get make this dynamic colored box?
This script works but you must type "red" into the field(including quotation marks).  Any ideas on why the word red alone isn't triggering it? 
var vcolor = this.getField("GoalColor").value;
if (vcolor == "red") {
    this.getField('GoalColor').fillColor = color.red;
} else {
    this.getField('GoalColor').fillColor = color.white;
I have also tried - works if you type 'red'
var vcolor = this.getField("GoalColor").value;
if (vcolor == 'red') {
    this.getField('GoalColor').fillColor = color.red;
} else {
    this.getField('GoalColor').fillColor = color.white;
and  - does not work
var vcolor = this.getField("GoalColor").value;
if ( vcolor == red ) {
    this.getField('GoalColor').fillColor = color.red;
} else {
    this.getField('GoalColor').fillColor = color.white;
Thanks!

And you don't need to add the quotation marks in the text field. In fact, doing it will cause the script not to identify the word.

Similar Messages

  • Possible to change review text color and wording

    I've searched high and wide to try changing the text color for the review mode field "CORRECT ANSWERS" that shows on a fill in the blank/ short answer question. Ideally I'd like white text (it's set at black) and I'd like to have it say "Correct answer(s)" or even somethinge else. I don't like the all caps that's used either.
    I've looked at the Object Style Manager but I don't see this particular field available/editable. Has anyone found where in the c:\Program Files\Adobe... files this setting is controlled - a .dll, .xml, .txt? I don't mind changing it to white there if I have to.

    Hi, thanks. Cap 7. I whipped up that course from scratch, no particular theme applied. Also to answer your question, I looked at the master slide and that particular review mode field isn't present, just the initial objects like the text input field.It's frustrating how everything but the CORRECT ANSWERS label is editable via the Object Style Manager. Why they forgot to include it is beyond me. I'm left at using "Hack a Cap" methodology by looking at all the .dll, txt. xml files hoping to fix it there because as far as I know you can't just turn the CORRECT ANSWERS field off even if you wanted to. Unfortunately almost all of our screenshots in our courses will have a royal blue background.

  • How to change Object Stroke Color and fill Color?

    Hi to all
    i need to change fillcolor & stroke color of Object
    here i wrote code that tried but it is not
    myDoc = app.activeDocument;
    var dd = myDoc.colors.add({name:"PANTONE Black C", model:ColorModel.spot, colorValue:[0, 13, 49, 98]});
    app.findObjectPreferences= NothingEnum.NOTHING;
      app.changeObjectPreferences = NothingEnum.NOTHING;
      app.findObjectPreferences.fillColor = "Black";
      var myI1 = myDoc.findObject();   
       app.changeObjectPreferences.fillColor = "PANTONE Black C // here error throwing
        app.changeObject ();
    app.findObjectPreferences= NothingEnum.NOTHING;
      app.changeObjectPreferences = NothingEnum.NOTHING;
      app.findObjectPreferences.strokeColor = "Black";
      var myI2 = myDoc.findObject();   
       app.changeObjectPreferences.strokeColor = "PANTONE Black C // here error throwing
        app.changeObject ();
    Error is :  Invalid value for set property 'fillcolor' ,Expected Swatch, String or NothingEnum enumerator, but received "PANTONE Black C";
    pls help me...
    Thanks
    Thangaraj

    Hi scriptor,
    how to create find change query for object search
    pls tell me with script.
    here i attached one jpg file screen shot to understand my need
    Thanks
    Thangaraj

  • Change Text Color and Background

    Hello
    I need to change the text colour and background for an entire text box and it's contents with as little iteration as possible
    For the Background I am using textframe.fillcolor
    and for the text I am usinf textframe.parentstory.fillcolor
    Is this correct?
    Thanks

    Hey!
    Yeah, that's ok.
    Also you can adjust color tint, and color text per paragraph like this:
    //fill text frame with color
    app.selection[0].fillColor = app.activeDocument.swatches.item("Red");
    //adjust fill color tint
    app.selection[0].fillTint = 20;
    //fill second paragraph
    app.selection[0].parentStory.paragraphs[1].fillColor = app.activeDocument.swatches.item("Red");
    //fill third line
    app.selection[0].parentStory.lines[2].fillColor = app.activeDocument.swatches.item("Red");
    Hope it helps!
    tomaxxi
    http://indisnip.wordpress.com/

  • Changing Label text color based on some conditions

    Hi,
    I have these labels and I would like to change the text color IF the text has some specific value (coming from an XML created by a program); for example the default text color is red, but if the text value is "Yes", the text color should be green.
    Any helps much appreciatted, as usual...
    Thanks.

    unsure, but you might be able to get away with something like this:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
        <mx:Script>
            <![CDATA[
                public function changeColor(value:String):uint
                    if(value == "Yes")
                        return 0x007F00;
                    else
                        return 0x7F0000;
            ]]>
        </mx:Script>
        <mx:Panel x="343" y="199" width="250" height="200" layout="absolute">
            <mx:Label id="lbl1" text="Yes" color="{changeColor(lbl1.text)}" x="102.5" y="10"/>
            <mx:Label id="lbl2" text="BlahhhhhBlahhhh" color="{changeColor(lbl2.text)}" x="97" y="36"/>
            <mx:Label id="lbl3" text="Exampleeeeeeee"  color="{changeColor(lbl3.text)}" x="97" y="62"/>
        </mx:Panel>
    </mx:Application>
    using a single label in an item renderer, passing across the 'data.text' value

  • I udate my os to 10.6.7 and since then my Pages have color problems. The text is not visible (white on white background) it does'nt help to change the text color nor background color. Pls help

    I udate my os to 10.6.7 and since then my Pages have color problems. The text is not visible (white on white background) it does'nt help to change the text color nor background color. I just download the recent trail version of Iworks and install it. The first document I opened it was ok. When I open the second one the problem appear again and stayed. Pls help

    This behavior was described many times.
    In every occurrence,the operating system was an uncompleted one resulting of the use of Software Update to update the operating system to 10.6.2, 10.6.3, 10.6.4, 10.6.5, 10.6.6, 10.6.7.
    In such cases, the solace was to apply a combo updater.
    As you are using 10.6.7, download and apply the combo 10.6.7 :
    http://support.apple.com/kb/DL1361
    After that, run Software Update which will urge you to apply :
    Snow Leopard Font Update
    Yvan KOENIG (VALLAURIS, France) dimanche 29 mai 2011 21:15:58
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How do change the text color in the variable screen ?

    Hi Experts ,
    I would like to know about , How do change the text color in the variable screen ?
    Using web templates (Analytical) can get the output. It has the variable screen contains 6 fields (Company code, Country , Region , COB, Plant and Purchasing Group). I want to make RED color text on Plant. Please help me .
    Thank you ,
    Prasad.

    Hi,
    I am looking for nearly the same. What I have found is that it seems to manipulate the SAP theme that is used in standard when template is executed in the portal. Just display the source code of the HTML and there you will see the included SAP theme (normally SAP_TRADESHOW). Then you have to go to the SAP portal and change this stuff. But for that you have to know where to find it and what impact this change has.
    I am not pretty sure if this is the right way. But as I want to change the standard layout of a whole template to a customer specific layout I think there is no other way in BI7.0.
    Regards,
    Peter

  • How do I change the text color of footers on select pages? (InDesign CS6)

    Good afternoon,
    Months ago, I worked with a graphic designer to put together a 100-page workbook for my training company. He turned all of the files over to me and I'd like to make a small change before we print another run for a new client. Specifically, I'm having trouble changing the text color on select pages. Since a picture says 1,000 words, let me give you an example:
    As you can see, the copyright information on the right side of the page is difficult to read here when placed over the photo (you may have to look closely, but it's along the guy's sleeve). What I'd love to do is change that part of the footer (not the left, page number side) to white text. This would make it quite a bit easier to read. There's a number of other pages in the book that I want to make this change to. I'm not sure why I never noticed it or mentioned it to the designer. I suppose I've become more discerning since then.
    Let me tell you what I've tried to do:
    I learned how to override master pages by CTRL+SHIFT clicking on the footer. However, this has not worked for me. It allows me to change the page number part, but not the copyright side. Additionally, sometimes when I override the master the formatting of the footer goes goofy. For instance, the left side and right side come together and end up in the middle of the page I'm working on.
    I'm looking for a quick way to go through and make the footers easier to read on pages where they are backed by a photo. Hoping you can help me. Please let me know if you need any other information.
    Best,
    Taylor

    I think you should have left it as it was. It seems like what you had was single pages flowing as spreads within InDesign. Like below. That is the correct way, and when you changed it to all single, it did create your footer problems.
    Will you be sending the file as a PDF to your online printer? If so, then leaving the InDesign file set as below is fine. The PDF output will separate the pages.
    All you have to do is make sure that Pages, not Spreads, is chosen when you output the PDF

  • How do i change the text color in ichat?

    How do i change the text color in ichat?

    Hi,
    In One Chat by word or letter go to the Format Menu as you type (Highlight and change like you would in any other App)
    On a more permanent basis the Font, it's colour and the IM background colour are set in iChat Menu > Preferences > Messages
    10:12 PM      Wednesday; November 23, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How to change the text color to red in a combo box?

    I'm writing a java program which have a combo box which shows all the name of the member from the database. However, I would like to change the text color of those member who have now currently on-line.
    Please help, it's URGENT. Thanks in advance.
    Clark

    hi,
    as i mentioned, you would require to use a custom renderer for this, for this
    //Class subclass the JFrame and has a JList in it
    import javax.swing.*;
    import java.awt.*;
    import java.util.Vector;
    public class ListRendererTest extends JFrame
         private JList lstMenu;
         private DefaultListModel defaultListModel;
         private JScrollPane scrollPane;
         private Vector listVector;
         public ListRendererTest()
              init();
              addComponents();
              showFrame();
         public void init()
              lstMenu = new JList();
              defaultListModel= new DefaultListModel();
              lstMenu.setModel(defaultListModel);
              scrollPane      = new JScrollPane(lstMenu);
              listVector = new Vector();
              MyListData m1 = new MyListData();
              m1.setName("Rakesh");
              m1.setOnline(false);
              listVector.addElement(m1);
              m1 = new MyListData();   //represents each User instance
              m1.setName("Makesh");
              m1.setOnline(true);
              listVector.addElement(m1);
              for (int i=0;i < listVector.size(); i++)
                   defaultListModel.addElement(((MyListData)listVector.elementAt(i)));
              lstMenu.setCellRenderer(new MyListRenderer());  //set custom renderer
         public void addComponents()
              getContentPane().add(scrollPane,BorderLayout.CENTER);
         public void showFrame()
              setTitle("List renderer test");
              setSize(300,300);
              setLocation(200,200);
              setVisible(true);
         public static void main(String args[])
              new ListRendererTest();
    }The above class is the Container which houses the JList in it, it uses two other classes, MyListData which is used to represent each user instance ( username, and information about whether he is online) and MyListRenderer (custom renderer).
    // Represents each user instance //
    public class MyListData
         private String name;
         private boolean online;
         public void setName(String name)
              this.name = name;
         public String getName()
              return name;
         public void setOnline(boolean online)
              this.online = online;
         public boolean isOnline()
              return online;
    //custom list renderer
    import javax.swing.*;
    import java.awt.*;
    public class MyListRenderer extends DefaultListCellRenderer
         private MyListData myListData;
         public Component getListCellRendererComponent(JList list, Object value, int index,  boolean isSelected, boolean cellHasFocus)
               myListData = (MyListData)value;
               setText(myListData.getName());
               setBackground(myListData.isOnline() ? Color.red: Color.white);  //check if online, if so show in different color
               setForeground(isSelected ? Color.blue : Color.black);
               return this;
    }hope that helps.
    cheerz
    ynkrish

  • How do you change the text color in your junk mail folder

    How do you change the text color in your junk mail folder?

    Try Mail Preferences/Junk tab and under " When Junk Mail Arrives" click Performe Custom Action then advanced
    you will see the option for colors.
    Hope this helps

  • Changing hyperlink text colors.

    I saw few posts asking about changing hyperlink text colors. And there are many camps regarding this topic. Suzanne Boben would recommend editing template XML . Some would recommend editing published HTML code. Some would recommend editing CSS code.
    But it came down to couple things.
    1) proficient in XML, HTML or CSS
    2) tried different colors, but it did turned out as expected
    One easy way is editing CSS files, this only apply to pages' hyperlink text; if your text got turn to PNGs, read no further .
    iWeb generates a CSS file for the associated HTML page - CSS file is in the Page_files folder.
    Edit the CSS files and keep copies of them, then you won't have to edit them again the next time you publish you sites.
    These CSS files are quite easy to understand, all you have to do is to look for a { , a:visited { and a:hover { .
    They contain RGB (Red Green Blue) values for link color, visited link color and rollover color.
    But what about those #8000FF and #4c4c4c?
    Well, I know they are RGB hexadecimal color values, but I don't what colors they are, so I came up with Argiope (Argiope is a family colorful spiders).
    It's a colors picker application to help with choosing background color, link color and rollover color. It'll give you the exact RGB hexadecimal value of chosen color.
    You can find Argiope here. Enjoy

    It can be done, but I have to do too much works.
    I already have a a script to do that, but it's quite complicated for an average bear.
    http://www.geocities.com/[email protected]/iWeb_utils --> LinksColors.zip
    Does just that, it is flexible, you can configure the colors for individual page, but it is quite different to configure. Look at the colors.txt and page.txt.
    If you really want to know more, ping me.

  • Changing hyperlink text color...

    I see how to change hyperlink text colors for a page (normal, rollover, visited, active) but I am hoping for something more complicated- I would like a link to change color on rollover, but stay that color until another link is clicked, then return to its original color. ( I have a swap image applied to five links on a page, clicking on each word displays a different image.) Is there any code I can add that will get a link to remain a rollover color until something else is selected? Thanks in advance!

    CSS menus are much leaner and more efficient than image rollovers.
    Persistent Page Indicator on CSS Menus
    http://alt-web.com/Articles/Persistent-Page-Indicator.shtml
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • How can i change bookmarks text colors, not toolbar text color.

    I know how to change color of toolbar text but still want to change the text color of bookmarks.

    You can experiment with code like this in the userChrome.css file.
    *http://kb.mozillazine.org/userChrome.css
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #personal-bookmarks .bookmark-item > .toolbarbutton-text {color:#000!important; background-color:-moz-dialog!important}
    </nowiki></pre>
    The customization files userChrome.css (user interface) and userContent.css (websites) are located in the chrome folder in the Firefox profile folder.
    *http://kb.mozillazine.org/Editing_configuration

  • Problem editing text color and page properties due to favicon link

    I recently added a link to a sites favicon using the link tag. Following advice on the net this was added beneath the HTML tag and before the HEAD tag. I was using a Dreamweaver template for the site and it updated all pages with the new link in the non-editable area above HEAD and just after the template declaration.
    This was fine, unitl the user went to edit the site. He found that he could no longer get to page properties as he got an error that no page properties existed in editable areas... although there was an editable region for the page title. Also text color and highlighting were now disabled.
    Moving the link tag into the head area has resolved the editing issue, but it seems a strange bug. Is there some way to add something between HTML and HEAD and have it appear before the InstanceBegin of the template?

    You can edit text in any PDF by using trial version but as for as my knowledge and limited experience with Adobe I could not find any text color option in Adobe Acrobat. But you can highlight text in Adobe Acrobat. If you want to change the text color in PDF, I would like to recommend some another software which allows you to change the color of text and is available for download here.
    Let me tell you how can change text color using this software. Open PDF file > go to "edit tab" > Click "edit" then highlight text to change the color. As you can see in the below screenshot.
    Free free to ask. Hope it helps you. Don't forget to come back to share your views.
    Thanks

Maybe you are looking for