I'm writing a Backend System and I want to allow the users to change their email address. I've written a custom validator to check if the email-address the user has entered already exists in my database.
Now I ran into a problem: The form is populated with the user data, so his email address is the default value of the email field. Now if the user submits the form, my validators throws an error, because (of course) this email address does already exist!
How can I solve this problem? Maybe a Validator is not the right approach to do this? Or is there a solution to detect if the user changed the default value and fire the validator only in that case?