We created a custom membership form that was not working properly, allowing you to skip through the form without filling out required fields, and even if you did fill them out and signed up, it would not register any information.
Fast forward, someone responded to the forum post regarding this original problem, providing the necessary code:
https://www.wix.com/corvid/forum/community-discussion/why-is-custom-sign-up-membership-form-not-working-when-i-add
https://www.wix.com/corvid/forum/community-discussion/why-is-custom-sign-up-membership-form-not-working-when-i-add
import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
$w.onReady(function () {
$w('#signup').onClick( () => {
let participatingagent = $w("#participatingagent").value
let email = $w("#email").value
let redidagent = $w("#redidagent").value
let officephone = $w("#officephone").value
let fax = $w("#fax").value
let participatingfirm = $w("#participatingfirm").value
let agentcell = $w("#agentcell").value
let redidoffice = $w("#redidoffice").value
let address = $w("#address").value
let password = $w("#password").value
let upload = $w("#uploadbutton").value
wixUsers.register(email, password, {
"contactInfo": {
"participatingagent": participatingagent,
"participatingfirm": participatingfirm,
"redidagent": redidagent,
"redidoffice": redidoffice,
"agentcell": agentcell,
"officephone": officephone,
"fax": fax,
"address": address,
}
})
.then((result) => {
wixLocation.to('/plans-pricing');
});
});
});
Now, when you go to the form, the required fields need to be filled out, and registration goes through when you sign up. However, it is not capturing all the data in the Contact List. The necessary fields are there (each field was synced with Contacts), however most of them are blank, even after filling them out during registration.
The “PrivateMembersData” database does not work because it does not match with the fields in our custom registration form, but it does log the info that we do have in the form that matches with the database (e.g. email, phone, etc.) Is there specific script that needs to be added to this database to change the database fields properly?
Is there a way we can edit these fields to match our registration form? We also created a separate database with the same titles of the fields in the registration form. If so, how do we connect it/replace the “PrivateMembersData”? Not sure which approach to take, if either of these are the way towards the solution, but would appreciate guidance on this!