# Custom registration and contact info

**URL:** <https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [December 23, 2018, 5:08pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203 "2018-12-23T17:08:17Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![coach89892](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/coach89892/32/7744_2.png) [@coach89892](https://forum.wixstudio.com/u/coach89892)\
**Post date:** [December 23, 2018, 5:08pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/1 "2018-12-23T17:08:17Z")

</div>

Hello, I am new to coding and have run into something I cant seem to solve.  
I am trying to create a custom member registration for my website that also collects and inputs some contact info into my CRM on Wix.  
If anyone could point me in the right direction of a code snipet that might do this I would be helpful. I was able to figure out the registration portion but not the contact info portion.  
Again very new to this so any rudimentary help would be appreciated.

---

<div class="post-metadata">

**Author:** ![sapirh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sapirh/32/6655_2.png) [@sapirh](https://forum.wixstudio.com/u/sapirh)\
**Post date:** [December 24, 2018, 11:40am UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/2 "2018-12-24T11:40:57Z")

</div>

Hi Nick,

I believe these articles will help you.

> **[Wix Automations: Creating Automations for CMS Form Submissions | Help Center...](https://support.wix.com/en/article/wix-automations-creating-automations-for-cms-form-submissions)**
>
> Make sure all your custom-built CMS form submissions are automatically handled appropriately. With Wix Automations, choose from a variety of actions that can oc

> **[Velo Tutorial: Creating a Custom Registration Form with Code | Help Center |...](https://support.wix.com/en/article/velo-tutorial-creating-a-custom-registration-form-with-code)**
>
> Visit the Velo by Wix website to onboard and continue learning.When you add membership functionality to your site, you receive a default form for registering si

Best,  
Sapir

---

<div class="post-metadata">

**Author:** ![coach89892](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/coach89892/32/7744_2.png) [@coach89892](https://forum.wixstudio.com/u/coach89892)\
**Post date:** [December 24, 2018, 3:58pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/3 "2018-12-24T15:58:44Z")

</div>

Thanks for the response Sapir, I was trying to follow that article yesterday. I don’t care about the tag portion of that so I think I get myself into trouble when I remove that portion. this is what I have.

**import** wixUsers **from** ‘wix-users’;

$w.onReady( **function** () {  
$w(‘#register’).onClick( () =\> {

// register as member using form data  
wixUsers.register($w(‘#email’).value, $w(‘#password’).value, {  
“contactInfo”: {  
“firstName”: $w(‘#firstName’).value,  
“lastName”: $w(‘#lastName’).value,  
“phone”: $w(‘#phone’).value,  
“street”:$w(‘#street’).value,  
“city”:$w(‘#city’).value,  
“state”: $w(‘#state’).value,  
“birthday”: $w(‘#birthday’).value,  
“zip”:$w(‘#zip’).value,  
“goal”:$w(‘#goal’).value,  
“emails”:$w(‘#email’).value  
}  
});

});  
});

the problem I am now facing is when I click the register button on my registration page nothing happens at all

---

<div class="post-metadata">

**Author:** ![sapirh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sapirh/32/6655_2.png) [@sapirh](https://forum.wixstudio.com/u/sapirh)\
**Post date:** [December 26, 2018, 7:54am UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/4 "2018-12-26T07:54:55Z")

</div>

Hi Nick,

Can you please send us a URL to your site and specify the name of the page so we can inspect?

Best,  
Sapir

---

<div class="post-metadata">

**Author:** ![coach89892](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/coach89892/32/7744_2.png) [@coach89892](https://forum.wixstudio.com/u/coach89892)\
**Post date:** [December 27, 2018, 12:23pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/5 "2018-12-27T12:23:27Z")

</div>

Thanks Sapir. My website is [https://www.p3fitness.co/](https://www.p3fitness.co/) I have been trying to do this using a lightbox simply named “register” and am now thinking perhaps I need to use a page dedicated to this purpose not a lightbox? any help or insight you can offer is always appreciated.  
Thank You  
Nick

---

<div class="post-metadata">

**Author:** ![sapirh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sapirh/32/6655_2.png) [@sapirh](https://forum.wixstudio.com/u/sapirh)\
**Post date:** [December 30, 2018, 3:26pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/6 "2018-12-30T15:26:35Z")

</div>

Hi,

I believe the problem is that your “register” button has a link to another page after the onClick() even occurs but it also need to do the registration and its can cause a problem.

View the code bellow:

```javascript
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';

$w.onReady(function () {
  $w('#register').onClick(() => {

 // register as member using form data
    wixUsers.register($w('#email').value, $w('#password').value, {
 "contactInfo": {
 "firstName": $w('#firstName').value,
 "lastName": $w('#lastName').value,
 "phone": $w('#phone').value,
 "street": $w('#street').value,
 "city": $w('#city').value,
 "state": $w('#state').value,
 "birthday": $w('#birthday').value,
 "zip": $w('#zip').value,
 "goal": $w('#goal').value
 // //"emails":$w('#email').value- No Need!
        }
      })
      .then(() => {
        wixLocation.to("...."); //The name of the page
      });

  });
});

```

Hope its help,  
Best,  
Sapir

---

<div class="post-metadata">

**Author:** ![coach89892](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/coach89892/32/7744_2.png) [@coach89892](https://forum.wixstudio.com/u/coach89892)\
**Post date:** [December 31, 2018, 2:27pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/7 "2018-12-31T14:27:18Z")

</div>

Sapir , thank you so much for the help. That certainly did solve some of the problem. The lightbox now registers someone for the website. However two issues still remain.  
#1 the form doesn’t auto fill any contact info to my contacts list, it does transfer my custom fields “birthday” and “goal” but phone and address don’t fill.  
#2 after clicking register the users cannot sign up for my “paid plan” and when hey click login they are prompted to my same register page and the cycle seems endless.

Any further thoughts? I apologize for my lack of skills an knowledge

---

<div class="post-metadata">

**Author:** ![trisha](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@trisha](https://forum.wixstudio.com/u/trisha)\
**Post date:** [January 4, 2019, 7:22am UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/8 "2019-01-04T07:22:39Z")

</div>

I’m still waiting to find out if we can write to those fields as well. I had to create custom fields to hold the address, city, state, zip, phone fields since I can’t seem to write to the CRM default fields. I called my custom fields: homeAddress, homeCity, homeState, homeZip, homePhone. It works, but it leaves the default fields in the CRM contact form empty.

---

<div class="post-metadata">

**Author:** ![sapirh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sapirh/32/6655_2.png) [@sapirh](https://forum.wixstudio.com/u/sapirh)\
**Post date:** [January 7, 2019, 10:12am UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/9 "2019-01-07T10:12:57Z")

</div>

Hi,

First, phone field suppose to be saved as a string so maybe that’s was the problem.  
Reference to the “Address object”, we have checked this issue and reported to our developers.  
Meanwhile, in order to add the user’s address details such as city, zip-code, country and more, create new custom field for each option.  
View this link in order to learn how to add a custom field, moreover pay attention that you are not choosing address as the field type.

> **[Adding Custom Fields to Contacts | Help Center | Wix.com](https://support.wix.com/en/article/adding-custom-fields-to-contacts)**
>
> Add custom fields to store additional information about your contacts. Custom fields can be either text, number, date or URL and can have any name you choose.An

Afterword, in the register() function add to the **contactInfo** object these custom fields.  
At your member list these new custom fields will be presented on each member’s Contact Info.

Best  
Sapir

---

<div class="post-metadata">

**Author:** ![coach89892](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/coach89892/32/7744_2.png) [@coach89892](https://forum.wixstudio.com/u/coach89892)\
**Post date:** [January 7, 2019, 9:27pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/10 "2019-01-07T21:27:39Z")

</div>

Sapir-

Thank you so much for your help, that certainly solved my CRM problems!  
I am facing one last challenge. When someone clicks the login button top right of my website and proceeds to fill out the registration form, they can fill it out, and click register, they are directed to the proper page, however they are not registered or logged in to the website.  
However, if a user clicks on my ‘paid plan’ they are prompted to the same registration form and the form functions how it should, registers the user and logs them in.  
two questions  
#1 is there a reason the same form functions properly when clicked on in the registration box vs. the login bar?  
#2 is there a way for me to create a second login only lightbox for users who are already site members?

Thanks again for all your help, I am so close!!

---

<div class="post-metadata">

**Author:** ![sapirh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sapirh/32/6655_2.png) [@sapirh](https://forum.wixstudio.com/u/sapirh)\
**Post date:** [January 9, 2019, 9:38am UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/11 "2019-01-09T09:38:47Z")

</div>

Hi Nick,

I viewed your site and I don’t understand the flow you would like to achieve for your users, can you please elaborate?  
Moreover, where is the registration lightbox is being triggered?

Best,  
Sapir

---

<div class="post-metadata">

**Author:** ![coach89892](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/coach89892/32/7744_2.png) [@coach89892](https://forum.wixstudio.com/u/coach89892)\
**Post date:** [January 9, 2019, 5:55pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/12 "2019-01-09T17:55:28Z")

</div>

Sapir-  
I would like a user to be able to click the login button at the top right of the page and be prompted with my registration lightbox in order to register as a member of my site. In the end I want the box to function almost identically default registration window and login window now only I would like to collect some contact details not just email and password.

I hope that answered your questions, again I am new to coding and website design so I wasn’t 100% sure what you were asking.

Thank you for your help  
Nick

---

<div class="post-metadata">

**Author:** ![sapirh](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/sapirh/32/6655_2.png) [@sapirh](https://forum.wixstudio.com/u/sapirh)\
**Post date:** [January 16, 2019, 2:39pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/13 "2019-01-16T14:39:42Z")

</div>

Hi NIck,

Go to the Login tab’s properties and connect the registration lightbox .  
Press Member signup setting and choose the correct light box from the list.  
As a result after pressing on the Log in button the lightbox will pop up and not the builtin LogIn form of wix.

 ![](https://us1.discourse-cdn.com/wix/original/3X/1/a/1aaf780c51a1f638f980d9cf4628cd992231d341.png)  
Best,  
Sapir

---

<div class="post-metadata">

**Author:** ![bolzthomas](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bolzthomas/32/15927_2.png) [@bolzthomas](https://forum.wixstudio.com/u/bolzthomas)\
**Post date:** [February 15, 2020, 7:05pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/14 "2020-02-15T19:05:42Z")

</div>

@sapirh  
Hi Sapir!  
Quote: “Reference to the “Address object”, we have checked this issue and reported to our developers.”  
Did you get a feedback to this issue? I still couldn´t find a way to add the address, city, state and zip to the standard Contact fields. The contactInfo Object doesn’t contain these values. To use custom fields in CRM is no option for me, because i have to create invoices with wix-invoice which uses the contacts default address fields!  
Thanks for your assistance,  
Tom

---

<div class="post-metadata">

**Author:** ![givemeawhisky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/givemeawhisky/32/5383_2.png) [@givemeawhisky](https://forum.wixstudio.com/u/givemeawhisky)\
**Post date:** [February 15, 2020, 8:21pm UTC](https://forum.wixstudio.com/t/custom-registration-and-contact-info/15203/15 "2020-02-15T20:21:42Z")

</div>

Old post from 2018 reappearing, closed.

This previous forum post will help too.  
[https://www.wix.com/corvid/forum/community-discussion/member-s-collection-address%3Fpage%3D1%26dl%3D5ce7fb33227f2d0016962c8b%252F5ce333e054670c00a4d64602%252F2](https://www.wix.com/corvid/forum/community-discussion/member-s-collection-address%3Fpage%3D1%26dl%3D5ce7fb33227f2d0016962c8b%252F5ce333e054670c00a4d64602%252F2)
