Hello again
Im creating a custom Registration page, where some user input shall go to the member-database, and two of the fields(email/password) goes to wix user registration (this works).
Email should go to both places.
The rest, like name, Birthdate, etc, should go into the member-database.
I use some code to send the email/password info to wix user registration.
This works, but the other info does not get submitted to the database.
I have connecetd the fileds to the database, and also the button, with property Submit,
the dataset is set to write, the database has custom settings, member, member, member author, member author.
How can I make this work, or what am I doing wrong?
Thanks
E.
Update:Problem Solved:
I managed to get the user input go into the database.
The problem seemed to be that I had directed the user to various landing pages after submitting, both from the code, and from the Button-settings.
I removed the piece of code that redirected the user, and then it worked
Well done for solving it yourself.
Just note that if you want to do something like that you can simply use the Wix default or custom signup windows or make up your own Corvid signup lightbox.
https://support.wix.com/en/article/about-the-member-signup-form
Corvid Lightbox Custom Code Example:
import wixUsers from 'wix-users';
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
$w.onReady(function () {
$w("#registerButton").onClick( (event) => {
let email = $w("#email").value;
let password = $w("#password").value;
let first = $w("#firstName").value;
let last = $w("#lastName").value;
wixUsers.register(email, password, {
contactInfo: {
"firstName": $w('#firstName').value,
"lastName": $w('#lastName').value,
}
} )
.then( (result) => {
let resultStatus = result.status;
wixWindow.lightbox.close();
wixLocation.to("/sign-in-status"); //Change the URL ending to whatever page you want to send the user to after they log in.
} );
} );
});
Then you can also setup a seperate members profile page as from this Wix tutorial here.
I have done similar and this works perfectly and closes after the user registers their details before moving them onto another page, then both names will be saved in Contacts List in your Dashboard via Wix CRM and once the new site member is manually approved the member details will be added to ‘members’ database from the above linked tutorial.
If you have set up your members to be automatically approved instead, then the details will be added immediately to both collections and not after the member is admitted through the manual option.
Thanks so much for passing this info thats going to help me accomplish some things I was trying to.
I just have one more question; Is the same possible to achieve just by using user input fields on a page, or is it only possible through a lightbox?
Thanks again.
You can do it all on a page, however to use the Wix Corvid option of lightboxes you will still need to have a lightbox setup for the members signup settings to be linked too.
However, if you simply make this lightbox blank and have a link to the actual page in the lightboxes pages onReady code, then there should be no hassle in having a page used instead as the lightbox should not show as there will be very minimal actions happening.
Nayeli (Code Queen) has added an extra little part to her own tutorial page about this as it has often been asked about, see more info here.
https://support.totallycodable.com/en/article/create-custom-log-in-sign-on-screen-using-wix-code#step-9-add-code-to-your-blank-lightbox-1
Thanks so much for the help GOS. I will work on this a bit now, try to make it work