Hi I have created validator Array concept. When i click submit button, Alert message not display, Can you please check code and give me a solution.
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()" > <mx:Script> <![CDATA[ import com.ln.concordance.view.ConcordanceHeaderMenu; import mx.validators.Validator; import mx.controls.Alert; [Bindable] public var arrCol:Array; public function initApp():void { arrCol = new Array(); arrCol.push(firstvalidate); arrCol.push(SecondNameName); arrCol.push(valueIntValidator); } public function initApplication1(evt:MouseEvent):void { var err:Array = Validator.validateAll(arrCol); Alert.show("" + err.length) if(err.length == 0) { /* this.addChildAt(new ConcordanceHeaderMenu(),1); */ Alert.show("Sucesss"); } else { Alert.show("connectivity Error"); } } ]]> </mx:Script> <mx:StringValidator id="firstvalidate" source="{FirstName}" property="text" requiredFieldError="Enter a field" /> <mx:StringValidator id="secondvalidate" source="{SecondNameName}" property="text" requiredFieldError="Enter a field"/> <mx:NumberValidator id="valueIntValidator" source="{telephone}" domain="int" requiredFieldError="Enter a number only" /> <mx:Form> <mx:FormItem label="First Name" required="true"> <mx:TextInput id="FirstName" tabIndex="0"/> </mx:FormItem> <mx:FormItem label="Second Name" required="true"> <mx:TextInput id="SecondNameName" tabIndex="1"/> </mx:FormItem> <mx:FormItem label="Telephone" required="true" > <mx:TextInput id="telephone" tabIndex="2" /> </mx:FormItem> <mx:FormItem> <mx:HBox> <mx:Button label="Submit" click="initApplication1(event)" /> </mx:HBox> </mx:FormItem> </mx:Form> </mx:Application> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

