DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Reset Form Validation Warnings In Flex
Validators declaration:
<mx:Array id="validators">
<mx:StringValidator source="{numberEditor}" property="text" required="true" minLength="3" />
<mx:StringValidator source="{nameEditor}" property="text" required="true" />
</mx:Array>
AS3 code:
public function resetForm():void {
formObject = new formObject(); // the object the form editors (TextInput / ComboBox / etc...) are binded to
callLater(resetValidationWarnings);
}
private function resetValidationWarnings():void {
for each (var validator:Validator in validators) {
UIComponent(validator.source).errorString = "";
}
}





