Hello,
Here is the code sniplet
public function Save():void
{
var vResult:ValidationResultEvent;
vResult = textValidator.validate();
if(vResult.type != ValidationResultEvent.VALID)
{
setValidationFocus(textBox);
return;
}
}
private function setValidationFocus(formObject:Object):void
{
Alert.show("Please correct the error(s) in the highlighted box.");
formObject.setFocus();
formObject.dispatchEvent(new MouseEvent(MouseEvent.MOUSE_OVER));
}
<mx:TextInput id="textBox" />
<mx:StringValidator id="textValidator" source="{textBox}"
minLength="5" maxLength="3" required="true" />
Cheers
Varun Rathore
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---