<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" fontSize="12" width="300" height="200">
<mx:Style>
<![CDATA[
.errorTip
{
fontSize: 12;
}
]]>
</mx:Style>
<mx:Validator id="nameV" source="{nameTI}" property="text" requiredFieldError="必须输入姓名!" trigger="{btn}" triggerEvent="click"/>
<mx:Validator id="ageV" source="{ageTI}" property="text" requiredFieldError="必须输入年龄!" trigger="{btn}" triggerEvent="click"/>
<mx:Validator id="sexV" source="{sexRBG}" property="selectedValue" requiredFieldError="必须选择性别!" trigger="{btn}" triggerEvent="click" listener="{maleRB}"/>
<mx:FormItem label="姓名:" width="150">
<mx:TextInput id="nameTI"/>
</mx:FormItem>
<mx:FormItem label="年龄:" width="150">
<mx:TextInput id="ageTI"/>
</mx:FormItem>
<mx:FormItem label="性别:" direction="horizontal" width="150">
<mx:RadioButtonGroup id="sexRBG"/>
<mx:RadioButton id="maleRB" groupName="sexRBG" label="男" value="1"/>
<mx:RadioButton id="femaleRB" groupName="sexRBG" label="女" value="0"/>
</mx:FormItem>
<mx:Button id="btn" label="提交" />
</mx:Application>
RadioButton 的检验
最新推荐文章于 2022-10-01 20:06:22 发布