I created a member’s area and created a custom registration form which I had working initially when it was a very simple version with only “first name, last name, company, job title.” It connected to the CRM just fine, populated my database etc.
I’ve had to turn it into a much more complicated form and it no longer connects to the CRM at all. I have it set so that members need approval and prior to changing my form, I received emails telling me someone had requested to join but it acts as if I’m not registering at all anymore. I have all of the custom fields set up and ready in the CRM…What am I missing?
import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
import wixData from “wix-data”;
$w.onReady( function () {
$w(“#submit”).onClick( (event) => {
let email = $w(‘#email’).value;
let password = $w(‘#password’).value;
let first = $w(‘#firstName’).value;
let last = $w(‘#lastName’).value;
let legalCompanyName = $w(‘#legalCompanyName’);
let publicCompanyName = $w(‘#publicCompanyName’);
let website = $w(‘#website’);
let description = $w(‘#description’);
let headOfficeStreet = $w(‘#headOfficeStreet’);
let headOfficeCity = $w(‘#headOfficeCity’);
let headOfficeProvince = $w(‘#headOfficeProvince’);
let headOfficePostalCode = $w(‘#headOfficePostalCode’);
let employeesInNuclear = $w(‘#employeesInNuclear’);
let contractorsInNuclear = $w(‘#contractorsInNuclear’);
let regionalStreet1 = $w(‘#regionalStreet1’);
let regionalCity1 = $w(‘#regionalCity1’);
let regionalProvince1 = $w(‘#regionalProvince1’);
let regionalPostalCode1 = $w(‘#regionalPostalCode1’);
let regionalStreet2 = $w(‘#regionalStreet2’);
let regionalCity2 = $w(‘#regionalCity2’);
let regionalProvince2 = $w(‘#regionalProvince2’);
let regionalPostalCode2 = $w(‘#regionalPostalCode2’);
let regionalStreet3 = $w(‘#regionalStreet3’);
let regionalCity3 = $w(‘#regionalCity3’);
let regionalProvince3 = $w(‘#regionalProvince3’);
let regionalPostalCode3 = $w(‘#regionalPostalCode3’);
let presidentName = $w(‘#presidentName’);
let presidentNumber = $w(‘#presidentNumber’);
let presidentEmail = $w(‘#presidentEmail’);
let assistantName = $w(‘#assistantName’);
let assistantNumber = $w(‘#assistantNumber’);
let assistantEmail = $w(‘#assistantEmail’);
let communicationsName = $w(‘#communicationsName’);
let communicationsNumber = $w(‘#communicationsNumber’);
let communicationsEmail = $w(‘#communicationsEmail’);
let localContactName = $w(‘#localContactName’);
let localContactNumber = $w(‘#localContactNumber’);
let localContactEmail = $w(‘#localContactEmail’);
let relationsName = $w(‘#relationsName’);
let relationsNumber = $w(‘#relationsNumber’);
let relationsEmail = $w(‘#relationsEmail’);
let accountsPayableName = $w(‘#accountsPayableName’);
let accountsPayableNumber = $w(‘#accountsPayableNumber’);
let accountsPayableEmail = $w(‘#accountsPayableEmail’);
let contributionAmount = $w(‘#contributionAmount’);
let year1 = $w(‘#year1’);
let year2 = $w(‘#year2’);
let year3 = $w(‘#year3’);
let applicationDate = $w(‘#applicationDate’)
wixUsers.register($w(‘#email’).value, $w(‘#password’).value, {
“contactInfo”: {
“firstName”: first,
“lastName”: last,
“legalCompanyName”: legalCompanyName,
“publicCompanyName”: publicCompanyName,
“website”: website,
“description”: description,
“headOfficeStreet”: headOfficeStreet,
“headOfficeCity”: headOfficeCity,
“headOfficeProvince”: headOfficeProvince,
“headOfficePostalCode”: headOfficePostalCode,
“employeesInNuclear”: employeesInNuclear,
“contractorsInNuclear”: contractorsInNuclear,
“regionalStreet1”: regionalStreet1,
“regionalCity1”: regionalCity1,
“regionalProvince1”: regionalProvince1,
“regionalPostalCode1”: regionalPostalCode1,
“regionalStreet2”: regionalStreet2,
“regionalCity2”: regionalCity2,
“regionalProvince2”: regionalProvince2,
“regionalPostalCode2”: regionalPostalCode2,
“regionalStreet3”: regionalStreet3,
“regionalCity3”: regionalCity3,
“regionalProvince3”: regionalProvince3,
“regionalPostalCode3”: regionalPostalCode3,
“presidentName”: presidentName,
“presidentNumber”: presidentNumber,
“presidentEmail”: presidentEmail,
“assistantName”: assistantName,
“assistantNumber”: assistantNumber,
“assistantEmail”: assistantEmail,
“communicationsName”: communicationsName,
“communicationsNumber”: communicationsNumber,
“communicationsEmail”: communicationsEmail,
“localContactName”: localContactName,
“localContactNumber”: localContactNumber,
“localContactEmail”: localContactEmail,
“relationsName”: relationsName,
“relationsNumber”: relationsNumber,
“relationsEmail”: relationsEmail,
“accountsPayableName”: accountsPayableName,
“accountsPayableNumber”: accountsPayableNumber,
“accountsPayableEmail”: accountsPayableEmail,
“contributionAmount”: contributionAmount,
“year1”: year1,
“year2”: year2,
“year3”: year3,
“applicationDate”: applicationDate
}
} )
.then( (result) => {
wixLocation.to(‘/thankyou’);
} );
} );
});