Hi guys
I really need some help here.
I tried to create a custom sign up form by using a 'Light Box'.
What i want to accomplish:
-customers who are not logged in, should get the pop-up from the light box to register as a member
-the info should be collected into my database 'members'
-the same form should also be used to put the collected information into my wix CRM. I want to collect all the users into my contact List and devide my customers into 'private customers' (=label1) and 'professional customers' (=label 2). If they complete the input field 'VAT-number' then they should get label 'Professional', if that field is empty, thenthey should get the label 'Private customer'.
This is my code i used:
// For full API documentation, including code examples, visit http://wix.to/94BuAAs import wixUsers from 'wix-users'; import wixData from 'wix-data'; import wixLocation from 'wix-location'; import wixCRM from 'wix-crm'; $w.onReady(function () { $w('#accaanmaken').onClick(function () { let label = label; let ondernemingsnr = $w('#ondernemingsnr').value; let firstName = $w('#voornaam').value; let lastName = $w('#naam').value; let email = $w('#email').value; let bedrijfsnaam = $w('#bedrijfsnaam').value; let phone = Number($w('#gsm').value); // Devide the client into professional clients & private customer if (ondernemingsnr === '') { label = "Particulier"; } else { label = "Professioneel" } // register as member using form data wixUsers.register($w('#email').value, $w('#paswoord').value, { "contactInfo": { "firstName": firstName, "lastName": lastName, "email": [email], "labels": [label], "bedrijfsnaam": bedrijfsnaam, "ondernemingsnummer": ondernemingsnr, "phone": [phone], "address": [$w('#straat').value, Number($w('#huisnummer').value), Number($w('#postcode').value), $w('#plaats').value, $w('#land').value] } }); // Put client info into wix crm wixCRM.createContact( { "firstName": firstName, "lastName": lastName, "emails":[email], "phones":[phone], "labels":[label], "bedrijfsnaam":bedrijfsnaam, "ondernemingsnummer":ondernemingsnr, "address": [$w('#straat').value, Number($w('#huisnummer').value), Number($w('#postcode').value), $w('#plaats').value, $w('#land').value] }) .then((contactId) => { // contact created }); }) })
This is my custom form (light box):
![](https://static.wixstatic.com/media/a27d24_5f09487139124ba4bbbe1b20153cf2b9~mv2.png/v1/fill/w_980,h_551,al_c,q_90,usm_0.66_1.00_0.01,enc_auto/a27d24_5f09487139124ba4bbbe1b20153cf2b9~mv2.png)
In preview mode, the data is collected into mmy database, but no customer contact info is collected into my CRM. On the live published site, nothing happens when the button is clicked. I did not at the code to navigate to the 'thank you' page, because i linked it as a 'submit'-button that redirects the customer to a link when clicked (=> thank you page URL is linked) by connecting it to my database... Who can help me out here? :) Have been struggling a lot already.