Hi,
I have been trying for days to figure out how to pass a checkbox group’s value(s) to a custom field in my contacts. I’ve created a custom sign up lightbox in Editor X and cannot seem to get the custom field to update. I am a novice at coding but have been able to figure things out as I go. I’ve scoured the API references and the internet for an answer but I cannot figure it out. I have a custom contact field named “Types of Goats” and my checkbox group’s ID is typesOfGoats. Can someone please help me out or point me in the right direction? Thanks!
import { authentication } from ‘wix-members’ ;
import wixLocation from ‘wix-location’ ;
let emails = ;
let phones = ;
$w . onReady ( function () {
$w ( ‘#joinBtn’ ). onClick ( () => {
const password = $w ( ‘#password’ ). value ;
const email = $w ( ‘#email’ ). value ;
const phone = $w ( ‘#phone’ ). value ;
const typesOfGoats = $w ( ‘#typesOfGoats’ );
emails . push ( email );
phones . push ( phone );
let options = {
contactInfo : {
firstName : $w ( ‘#firstName’ ). value ,
lastName : $w ( ‘#lastName’ ). value ,
typesOfGoats : $w ( ‘#typesOfGoats’ ). value ,
emails : emails ,
phones : phones ,
},
privacyStatus : 'PUBLIC'
}
authentication . register ( email , password , options )
. then (() => {
wixLocation . to ( ‘/plans’ )
});
});
});