Saturday, December 14, 2013

Validation Question

How do you validate / invalidate 1 field based on the other.

 

Example:

User changing password I have

Confirm current (no issues there)

New Password input

Confirm New Password input

 

Now I have it set password has to be minimum 8 characters for the sake of the question.

User enters new password 15 chars, all good, then confirm is 5 chars and I get hit with 2 errors.

Different passwords entered for new password field and Password must be minimum of 8 for confirm field.

No need to have 2 error messages I would think since the new password passed validation should only be 1 message saying not the same.

 

Any ideas? Best to put all the validation rules on new password and simply check they match on the confirm field?

 

I might have answered my own question.

 

But like to know what you think.

 

Thanks,

Dave

No comments: