浏览 2183 次
锁定老帖子 主题:flex验证
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2008-08-05  
<?xml version="1.0" encoding="utf-8"?> 
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> 
    <mx:Panel title="用户注册信息" width="359" height="303" x="24.5" y="37" fontSize="12"> 
        <mx:Form width="100%" height="100%" horizontalGap="0"> 
            <mx:FormHeading label="用户资料" width="100%"/> 
            <mx:FormItem label="用户名:" width="100%" required="true"> 
                <mx:TextInput width="100%" id="user_txt"/>                  
            </mx:FormItem> 
            <mx:FormItem label="密码:" width="100%" required="true"> 
                <mx:TextInput width="100%" displayAsPassword="true" id="pass_txt"/>                 
            </mx:FormItem> 
            <mx:FormItem label="性别:" width="100%" direction="horizontal"> 
                <mx:RadioButton groupName="isMale" label="男" />   <mx:RadioButton groupName="isMale" label="女" />     
            </mx:FormItem> 
            <mx:FormItem label="邮箱:" width="100%"> 
                <mx:TextInput width="100%" id="email_txt"/>                 
            </mx:FormItem> 
            <mx:FormItem label="电话:" width="100%"> 
                <mx:TextInput width="100%" id="phone_txt"/>                 
            </mx:FormItem> 
            <mx:FormItem label="出生年月:" width="100%"> 
                <mx:TextInput width="100%" id="birth_txt"/>                 
            </mx:FormItem> 
        </mx:Form> 
        <mx:ControlBar height="32" paddingBottom="0" paddingTop="0" horizontalAlign="center"> 
            <mx:Button label="确定"/> 
            <mx:Button label="重写"/> 
        </mx:ControlBar> 
    </mx:Panel> 
      
    <mx:StringValidator source="{user_txt}" property="text" minLength="6" maxLength="12" requiredFieldError="姓名不能为空" tooShortError="用户名太短了"/> 
    <mx:StringValidator source="{pass_txt}" property="text" minLength="6" maxLength="12"/> 
    <mx:PhoneNumberValidator source="{phone_txt}" property="text"/> 
    <mx:DateValidator source="{birth_txt}" property="text"/> 
    <mx:EmailValidator source="{email_txt}" property="text"/> 
   
</mx:Application> 
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics