// Event listener for the valid and invalid events. private function handleValid(eventObj:ValidationResultEvent):void { if(eventObj.type==ValidationResultEvent.VALID) // Enable Submit button. submitButton.enabled = true; else submitButton.enabled = false; }
// Submit form is everything is valid. private function submitForm():void { Alert.show("Form Submitted!"); }
]]> </mx:Script>
<!-- The Validator class defines the required property and the validator events used by all validator subclasses. --> <mx:Validator id="reqValid" required="true" source="{fname}" property="text" valid="handleValid(event)" invalid="handleValid(event)"/>