The following example shows how you can customize a Flex TextInput control’s error color and error string using the errorColor style and errorString property.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/09/01/customizing-a-flex-textinput-controls-error-color/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:ApplicationControlBar dock="true">
<mx:Label text="errorColor:" />
<mx:ColorPicker id="colorPicker" />
</mx:ApplicationControlBar>
<mx:Form>
<mx:FormItem label="text:" required="true">
<mx:TextInput id="textInput"
errorColor="{colorPicker.selectedColor}"
errorString="Custom error color" />
</mx:FormItem>
<mx:FormItem>
<mx:Button />
</mx:FormItem>
</mx:Form>
</mx:Application>
View source is enabled in the following example.





How do I change the background color around the custom color error message?
Anonymous (if that is you real name),
What if you try setting the
.errorTipstyle, like so:<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"> <mx:Style> @font-face { src: local("Base 02"); fontFamily: Base02Embedded; } .errorTip { borderColor: haloOrange; color: black; fontFamily: Base02Embedded; fontSize: 16; fontWeight: normal; } TextInput { errorColor: haloOrange; } </mx:Style> <mx:TextInput id="textInput" errorString="Hey, you missed a spot!" /> </mx:Application>Peter