I have a sign up page with the code below. Everything is working right. Contacts and Members are showing in the Members and Contacts List with the information in the right custom fields. However, there is one field I cannot figure the value of and that is the Address field (street, city, zipcode…).
What is the right syntax or field value of the Address field?
$w.onReady( function () {
$w(‘#submit’).onClick( () => { let email = $w(‘#email’).value //correct let password = $w(‘#password’).value //correct let firstName = $w(‘#firstName’).value //correct let lastName = $w(‘#lastName’).value //correct let phone = $w(“#phoneNumber”).value let street = $w(“#street”).value; let city = $w(“#city”).value; let state = $w(“#state”).value; let zipCode = $w(“#zipcode”).value; let company = $w(“#companyName”).value; //correct let companyType = $w(“#employerType”).value;//correct
Thank you for getting back to me!
When members enters their ADDRESS information (city, street, zip code) in the custom sign up page, it doesn’t work. Everything else appears in their Contact information including custom fields EXCEPT their address information.
So my question is what are the Field keys for the Street, city, state and Zip ?
I built the code listed with the DB, and using the page code listed i get a Parsing error: unexpected token at the last ) bracket. I removed the company and the company type just to speed up things.
// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import wixUsers from ‘wix-users’;
import wixLocation from “wix-location”;
import wixWindow from ‘wix-window’;
$w.onReady( function (){
$w(‘#submit’).onClick(() => {
wixUsers.register($w(‘#email’).value, $w(‘#password’).value, {
“contactInfo”: {
“firstName”: $w(‘#firstName’).value,
“lastName”: $w(‘#lastName’).value,
“phoneNumber”: $w(‘#phoneNumber’).value,
“street”: $w(‘#street’).value,
“city”: $w(‘#city’).value,
“state”: $w(‘#state’).value,
“zipcode”: $w(‘#zipcode’).value,
“password”: $w(‘#password’).value
}
}).then(() => {
//Everything went good, user was registered, now going to redirect
console.log(‘user registered successfully’);
wixLocation.to(‘/plans-pricing’);
}). catch ((err) => {
//If there is an error it will not redirect, it will console.log the error
console.log(${err}: Error)
});
Thank you for your reply dragonlord. Did you set up custom fields for those or are you writing to the default address fields?
I added custom fields that I can write to called HomeStreet, HomeCity, etc as you can see below, but they don’t populate the main CRM list or the top address fields (see below)
@dragonlord4469187 ok thank you. That is a “work-around” and not a solution. I, and I believe the OP, are looking to update the main field so it shows up on the CRM contact list. But thank you for your help
@trisha I see what your getting at. A thought i just had on this, you might try in the user profile member page adding the corresponding fields as if your user wanted to update their information and see if that will populate the default fields. If it does, then the next step would be how to achieve the same result but outside the members area.
@dragonlord4469187 I have done that, and it does update them, but I can’t see their code. I’ve asked support but they won’t say, they keep saying to ask on the forum.
Maybe one of the Wix coders will see this post and chime in. has anyone tried doing the form on a dynamic page? I don’t know that it would make any difference but i thought i read somewhere that the member pages were dynamic pages. If that is true, then maybe there is something special with how dynamic pages gets handled by the CRM? IDK, just grasping at straws.