/ Published in: ActionScript 3
Use this as a sample script to code flex data validations
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private var phoneValidator:PhoneNumberValidator; private function creationCompleteHandler():void { // // Create validators // // Phone validator phoneValidator = new PhoneNumberValidator(); phoneValidator.source = phoneInput; phoneValidator.property = "text"; } <mx:Panel title="Phone number validator"> <mx:Form> <mx:FormItem label="Name:"> <mx:TextInput id="nameInput" /> </mx:FormItem> <mx:FormItem label="Phone: "> <mx:TextInput id="phoneInput" /> </mx:FormItem> <mx:FormItem label="Email: "> <mx:TextInput id="emailInput" /> </mx:FormItem> </mx:Form> </mx:Panel>