I have this code, that works fine. It validates the password twice so they are correct. But I’m trying to add a field that will import to CMR & Contacts list as people become members. But I don’t have any idea how…
import wixUsers from ‘wix-users’;
import wixLocation from ‘wix-location’;
$w.onReady( function (){
$w(‘#registerNow’).onClick( function (){
let email = $w(‘#mail1’).value;
let password = $w(‘#losen1’).value;
let password2 = $w(‘#losen2’).value;
if (password === password2) {
//if password matches we console.log success message and register the user
console.log(“Dem matchar!”);
wixUsers.register(email,password)
.then(()=>{
wixLocation.to(‘/ny-registerade’);
})
}
//if password does not match console.log error message
else {
console.log(“Dem matchar inte!”);
}
})
})