I am having a very hard time with my custom member sign-up form. There must be something wrong with my code or how I set up the custom contact fields in the dashboard.
We need to approve new members manually. In order to do so, we must collect specific information before they can be approved. I created a custom form that is connected to a database. The sign-up part of the form works correctly. However, none of the information that is gathered in the form shows up in their contact info. When I click on a “new member request” notification in my dashboard, the only info that shows up is the email address. And, for some reason, the various other info from the form will show up about 25% of the time. It’s not consistent as at all. I really need help with this because we are unable to approve new members without this important info. We have over 2,000 members and it is not realistic for us to scroll through the database every time someone sends a new request. Please see my code and the other screenshots with examples of what I am talking about, below. I’m perplexed!
import wixUsers from 'wix-users';
$w.onReady(function () {
$w('#register').onClick(() => {
let emails = [];
let password = [];
emails.push($w('#email').value);
// register as member using form data
wixUsers.register($w('#email').value, $w('#password').value, {
"contactInfo": {
"firstName": $w('#firstName').value,
"lastName": $w('#lastName').value,
"credentials": $w('#credentials').value,
"practice": $w('#practice').value,
"stateProvince": $w('#stateProvince').value,
"country": $w('#country').value
}
})
.then(() => {
console.log('user registered successfully');
})
})
})
$w.onReady(function () {
const validatepassword = (otherPasswordElementId) => (value, reject) => {
let otherPasswordElement = $w(otherPasswordElementId);
if (value === otherPasswordElement.value) {
otherPasswordElement.validity.valid = true;
otherPasswordElement.resetValidityIndication();
return;
}
console.log("Password and Confirm Password fields do not match");
otherPasswordElement.validity.valid = false;
otherPasswordElement.updateValidityIndication();
reject("Password and Confirm Password fields do not match");
};
$w("#confirmPassword").onCustomValidation(validatepassword("#password"));
$w("#password").onCustomValidation(validatepassword("#confirmPassword"));
});
Below is a screenshot of how our member requests are coming coming in. None of their info is being saved from the form.
Sorry this is such a long post. I want to include as much info to help you understand the problem Im having.
Thank you!
Johanna