Since validators do not retain state, you do not have to disable/enable
them, just set the errorString property of the associated control to '',
as in:
 
name.text='';
name.errorString='';
 
Stephen

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of relisanhard52
Sent: Sunday, November 26, 2006 12:57 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] validation for form reset



Hi
I am having a form whose fields i can validate without any issues. I 
need to have an option of reset.
In my reset, i have

private function reset():void
{
nameValidator.enabled= false;

name.text='';

nameValidator.enabled= true;
}

This works fine when the user has input some text in name field and 
then resets it. But when user clicks reset without having entered in 
textinput, it shows the red outline with the error message on that 
field. I have pasted code above for just one field, obviously I have 
many other fields in the form.

Please advise how to successfully reset form, no matter if the user 
has input text in field or not. 

Regards
Husain



 

Reply via email to