# Already Existing Member  & email check - Custom member registration

**URL:** <https://forum.wixstudio.com/t/already-existing-member-email-check-custom-member-registration/23999>\
**Category:** Ask the community\
**Tags:** question, code, wix-members-area, wix-stores\
**Created:** [December 4, 2020, 2:14pm UTC](https://forum.wixstudio.com/t/already-existing-member-email-check-custom-member-registration/23999 "2020-12-04T14:14:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dragonfx1234](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/dragonfx1234/32/25053_2.png) [@dragonfx1234](https://forum.wixstudio.com/u/dragonfx1234)\
**Post date:** [December 4, 2020, 2:14pm UTC](https://forum.wixstudio.com/t/already-existing-member-email-check-custom-member-registration/23999/1 "2020-12-04T14:14:08Z")

</div>

Hi… I’m trying to make a custom member registration, But i can’t understand how to add a simple error message that check and show if the name and the email already exist in the members/database. This is my registration page code:

```javascript
import wixData from'wix-data';
import wixUsers from'wix-users';

$w.onReady(function () {

$w('#submitButton').onClick( (event) => { // submit button
let email = $w('#emailInput').value; // email input
let password = $w('#passwordInput').value; // password input

// the (below) code registers the user
  wixUsers.register(email, password)
  .then( (result) => {
 
let user = wixUsers.currentUser;
let userId1 = user.id;
 
 // the (below) code ,after registration, inserts the name, class, userId etc to database.
 
 let toInsert = {
 "name": $w('#nameInput').value, // id of the field where the name of students or parents store and name input.
 
 "class": $w('#istitutoInput').value, //id of the field where the class of students store and class input.
 
 "userId": userId1 
};
wixData.insert("Utenti", toInsert) // Database name
  .then( (results) => {
  console.log("User registered");
});
 
});
});

});

```

Please help me, thank you!
