1.邮件验证 <mx:EmailValidator id="emailV" source="{txtEmail}" property="text" invalidCharError="非法字符" invalidDomainError="非法域" invalidIPDomainError="非法IP域" missingAtSignError="缺少@符" missingPeriodInDomainError="缺少域后缀" missingUsernameError="缺少用户名"/>2.字符串长度验证 <mx:StringValidator source="{fname}" property="text" tooShortError="字符串太短了,请输入最少4个字符. " tooLongError="字符串太长了,请输入最长20个字符. " minLength="4" maxLength="20" trigger="{myButton}" triggerEvent="click" valid="Alert.show('字符串格式正确!');"/> 3.日期验证 <mx:DateValidator source="{txtDate}" property="text" required="true" requiredFieldError="请输入日期" allowedFormatChars="-" inputFormat="YYYY-MM-DD" trigger="{btnSubmit}" triggerEvent="click" valid="mx.controls.Alert.show('验证成功');" invalid="mx.controls.Alert.show('验证失败');" wrongDayError="日输入错误" wrongMonthError="月输入错误" wrongYearError="年输入错误" wrongLengthError="日期长度错误" invalidCharError="日期分隔符错误" formatError="inputFormat 配置错误"/>4.英文字母验证 <mx:RegExpValidator id="regExpValidator" source="{txtInput}" property="text" flags="g,i" expression="^[a-z]+$" valid="handleResult(event)" invalid="handleResult(event)" trigger="{btnSubmit}" triggerEvent="click" noMatchError="请输入正确的英文字母" required="false"/>5.年龄验证 <mx:NumberValidator id="ageV" source="{ageTI}" property="text" domain="int" minValue="6" maxValue="100" lowerThanMinError="年龄过小!" exceedsMaxError="年龄过大!" integerError="年龄必须是整数!" invalidCharError='输入了非数字字符!' requiredFieldError="必须输入年龄!" trigger="{btn}" triggerEvent="click"/>6.性别验证 <mx:Validator id="sexV" source="{sexRBG}" property="selectedValue" requiredFieldError="必须选择性别!" trigger="{btn}" triggerEvent="click" listener="{maleRB}"/> <mx:FormItem label="性别:" direction="horizontal" width="200"> <mx:RadioButtonGroup id="sexRBG"> <mx:RadioButton id="maleRB" groupName="sexRBG" label="男" value="1"/> <mx:RadioButton id="femaleRB" groupName="sexRBG" label="女" value="0"/> </mx:RadioButtonGroup> </mx:FormItem>