Member Registration with Custom Fields in a Wix Code Form

When the user completes this Wix Code form, I would like their information to be stored in Wix Contacts.

I have followed this tutorial: Velo Tutorial: Creating a Custom Registration Form with Code | Help Center | Wix.com

When I try the form in the editor:
I get a success message, but the information IS NOT showing up in Wix Contacts.

When I try the form on the live website:
I get an error message, but the information IS showing up in Wix Contacts.

Wix Contacts has been set up with these custom fields:

Here is the page code:

import wixUsers from ‘wix-users’;

$w.onReady( function () {
$w(‘#submitButton’).onClick( () => {
let emails = ;

emails.push($w('#emailUsername').value); 

// register as member using form data
wixUsers.register($w(‘#emailUsername’).value, $w(‘#password’).value, {
“contactInfo”: {
“firstName”: $w(‘#firstName’).value,
“lastName”: $w(‘#lastName’).value,
“emails”: emails,
“Phone Number”: $w(‘#phoneNumber’).value,
“Title”: $w(‘#title’).value,
“Company”: $w(‘#company’).value,
“Department”: $w(‘#department’).value,
“Street Address”: $w(‘#streetAddress’).value,
“City”: $w(‘#city’).value,
“State”: $w(‘#state’).value,
“Zip Code”: $w(‘#zipCode’).value,
“Password”: $w(‘#password’).value,
“Retype Password”: $w(‘#retypePassword’).value,

 } 
}); 

});
});

Any help is greatly appreciated,

FD

Hello Josh,

I can see the confusion between members and subscribers. What you are doing with the above code is registering users to your website, not creating a contact. The contacts API uses . createContact() instead of .register() as that is for wix-users.

Try using the .createContact() method instead of .register() and it should register that user as a contact.

Also you can request for converting site members to contacts here - https://support.wix.com/en/article/request-manually-setting-contacts-as-site-members

Goodluck
Majd