Validators can’t take binding expressions as values.  The easiest thing to do is write a simple Validator with a custom handler that will confirm the password and confirm_password are equal.

 

Something like this:

 

<mx:Validator field=”confirm_password” validate=”checkConfirm(event.validator)” />

 

<mx:Script>

  Function checkConfirm(validator: mx.validators.Validator)

  {

    if (confirm_password != password)

    {

      Validator.validationError(“mismatch”, “The confirmation and password fields do not match”);

    }

  }

</mx:Script>

 

Matt


From: Ketan Bengali [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 06, 200510:54 PM
To: [email protected]
Subject: [flexcoders] Passing value to custom validator

 

I have 2 fields : "password" & "confirm_pasword"
I have made a custom validator for confirm password.

How do I pass the value of passsword to confirm_password.
Tried but not getting it. Have declared a public variable "myPwd" in the
as file
and passing it in this way:      myPwd="{pwd.text}"


But while the validator gets executed it shows undefined as the value
for myPwd


Can anybody help me ?

Thanks.

--
Regards,

Ketan Bengali
Multimedia Programmer,
Silver Communication Pvt. Ltd.,
Pune.



Reply via email to