<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#874040, #874040]">
<mx:Model id="checkModel">
<User>
<FirstName>{fname.text}</FirstName>
<DOB>{dob.text}</DOB>
<Email>{email.text}</Email>
<Age>{age.text}</Age>
<Zip>{zip.text}</Zip>
<Phone>{phone.text}</Phone>
</User>
</mx:Model>
<mx:Panel title="Form Container: Moving from one form field to another triggers the validator" layout="vertical"
color="0xffffff" borderAlpha="0.15" width="500" height="240" paddingTop="0" paddingRight="10" paddingBottom="10"
verticalScrollPolicy="off" paddingLeft="10" horizontalAlign="center" y="47">
<mx:Form width="100%" color="0x323232" paddingTop="0">
<mx:FormHeading fontSize="10" label="Enter values into the form." paddingTop="0" />
<mx:FormItem label="First name">
<mx:TextInput id="fname" width="200"/>
</mx:FormItem>
<mx:FormItem label="Date of birth (mm/dd/yyyy)">
<mx:TextInput id="dob" width="200"/>
</mx:FormItem>
<mx:FormItem label="E-mail address">
<mx:TextInput id="email" width="200"/>
</mx:FormItem>
<mx:FormItem label="Age">
<mx:TextInput id="age" width="200"/>
</mx:FormItem>
<mx:FormItem label="Zip">
<mx:TextInput id="zip" width="200"/>
</mx:FormItem>
<mx:FormItem label="Phone">
<mx:TextInput id="phone" width="200"/>
</mx:FormItem>
</mx:Form>
</mx:Panel>
<mx:StringValidator source="{fname}" property="text" minLength="4" maxLength="12"/>
<mx:PhoneNumberValidator source="{phone}" property="text"/>
<mx:DateValidator source="{dob}" property="text"/>
<mx:EmailValidator source="{email}" property="text"/>
<mx:NumberValidator source="{age}" property="text" integerError="Enter Integer value"
minValue="18" maxValue="100" domain="int"/>
<mx:ZipCodeValidator source="{zip}" property="text"/>
No comments:
Post a Comment