Consider not doing server side like checks like that in the client.
Use a client side library to do field input checks. This ensure if registration fails, its either an email already exist (because you enforce that in the db) or another server side error happened. That's all you have to communicate to the user