Hello team, I am working on building a custom sign up form in a lightbox with Editor X. I have followed the tutorial and have managed to link correctly the following fields:
First Name
Last Name
Password
Email
Custom Field
However I am having difficulty linking input fields with the address field in the members data.
Please see below the code I have used:
import { authentication } from ‘wix-members’ ;
let emails = ;
$w . onReady ( function () {
$w ( ‘#register’ ). onClick ( () => {
const password = $w ( ‘#password’ ). value ;
const residence = $w ( ‘#residence’ ). value ;
const phone = $w ( ‘#telephone’ ). value ;
const addressLine = $w ( ‘#addressLine’ ). value ;
const city = $w ( ‘#city’ ). value ;
const postalCode = $w ( ‘#postalCode’ ). value ;
const email = $w ( ‘#email’ ). value ;
emails . push ( email );
let options = {
contactInfo : {
firstName : $w ( '#firstname' ). value ,
lastName : $w ( '#lastname' ). value ,
emails : emails ,
residence : $w ( '#residence' ). value ,
phone : $w ( '#telephone' ). value ,
city : $w ( '#city' ). value ,
postalCode : $w ( '#postalCode' ). value ,
addressLine : $w ( '#addressLine' ). value
},
privacyStatus : 'PUBLIC'
}
authentication . register ( email , password , options )
. then (( registrationResult ) => {
const status = registrationResult . status ;
// When the site is configured for automatic approval, status is “ACTIVE” and the member is approved and logged in.
console . log ( ‘Member registered and logged in:’ , registrationResult );
})
. catch (( error ) => {
console . error ( error );
});
});
});
Thanks all for your help!!!