首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

性别取舍标签RadioButton的使用

2012-11-03 
性别选择标签RadioButton的使用?一个RadioButton运用的例子,包含对标签的空值验证??xml version1.0 en

性别选择标签RadioButton的使用

?一个RadioButton运用的例子,包含对标签的空值验证

?

<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"           layout="absolute"           verticalAlign="middle"           backgroundColor="white" xmlns:ns1="*">         <mx:Script>           <![CDATA[           private var sexChang:String;           import mx.controls.Alert;               private function rb_change(evt:Event):void {                 var rb:RadioButton = evt.currentTarget as RadioButton;                  sexChang= rb.label;               }                  private function kk():void{               textInput.text=sexChang;               }                        ]]>     </mx:Script>     <mx:Validator id="sexV" source="{sexRBG}" property="selectedValue" requiredFieldError="必须选择性别!"  trigger="{btnRegister}" triggerEvent="click"  listener="{maleRB}" />                  <mx:FormItem label="性     别:" direction="horizontal" width="177" x="270" y="326">              <mx:RadioButtonGroup id="sexRBG"/>                   <mx:RadioButton x="10" id="maleRB" groupName="sexRBG" label="男" value="1" change="rb_change(event)"/>                         <mx:RadioButton id="femaleRB" groupName="sexRBG" label="女" value="0" change="rb_change(event)"/>               </mx:FormItem>      <mx:Button id="btnRegister" fontWeight="bold" click="kk()" x="294" y="373" width="88" height="45" label="选择性别" fontSize="13"/>    <mx:TextInput x="270" y="266" id="textInput"/> </mx:Application>

?

热点排行