import wixUsers from 'wix-users'; import wixLocation from 'wix-location'; $w.onReady(function() { $w('#register').onClick(function (){ let Rank = $w('#Rank').value; let firstName = $w('#firstName').value; let lastName = $w('#lastName').value; let Consistory = $w('#Consistory').value; let email = $w('#email').value; let password = $w('#password').value; let labels = []; // const Rank = $w('#Rank').value; // const Consistory = $w('#Consistory').value; // register as member using form data{ "contactInfo"; { "Rank"; ($w('#Rank').value), "firstName"; $w('#firstName').value, "lastName"; $w('#lastName').value, "Consistory"; ($w('#Consistory').value)} wixUsers.register(email, password) contactInfo: { "Rank"; [Rank] "firstName"; [firstName] "lastName"; [lastName] "Consistory"; [Consistory] } }) .then( (result) => { let resultStatus = result.status; });
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
https://www.wix.com/velo/forum/coding-with-velo/populating-customfields-wix-member-backend
Do you have two different posts for same issue running?
Please delete the uneccessary dublicate one.
Additionaly to Giri's suggested answer...
Perhaps you should also consider to do the registration on backend...
FRONTEND-CODE:
import { myRegisterMemberFunction() } from 'backend/REGISTRATION.jsw' $w.onReady(()=>{$w('#register').onClick(function(){registerUser();});}); function registerUser(){ let options = { contactInfo: { firstName: $w('#firstName').value, lastName: $w('#lastName').value }, privacyStatus: "PUBLIC" } myRegisterMemberFunction($w('#email').value, $w('#password').value, options); }
BACKEND-CODE: (REGISTRATION.JSW)
import { authentication } from 'wix-members-backend'; export function myRegisterMemberFunction(email, password, options) { return authentication.register(email, password, options) .then((member) => { return member; }) .catch((error) => { console.error(error); }) }
The contactInfo should be part of the arguments to .register. The example there below. Watch the , {. That is missing in your code.
wixUsers.register(email, password, { 12 contactInfo: { 13 "firstName": firstName, 14 "lastName": lastName, 15 "phones": [phone] 16 } 17 } ) 18 .then( (result) => {