I have simplified the registration form now. I have deleted some fields that are not needed (first name, last name, city, postal code, country). At the same time I have added a field (Username). I have also added username to the database table, and selected it as unique. I have also changed the email to unique in the table because it seems more correct.
I have changed the validation. But there is something wrong. WAs validation is not displayed when you press submit. I have written an email address that is already registered, but no error message, even though I have created one. Can you solve this?