Dear @Yisrael,
Some of my users are unable to continue to the next page whilest clicking on the button 'volgende' (English: 'Next') on the page: https://www.vocap.info/copy-of-inloggen. Most users however, do not experience any issues.
This page is for registration of the email and password in the wix members list.
The user input fields are:
'E-mail' (Eng.: email)
'Wachtwoord' (Eng.: password)
'Bevestig wachtwoord (Eng. confirm password)
This is an impression of the page in question:
The page code:
import wixUsers from 'wix-users'; import wixLocation from 'wix-location'; $w.onReady(function(){ $w('#register').onClick(function (){ let email = $w('#email').value; let password = $w('#password').value; let password2 = $w('#password2').value; //if the user is already logged in, we skip this page and go to the next page. if (wixUsers.currentUser.loggedIn === true) { wixLocation.to('/registreren'); } else if (password === password2 && password !== undefined && password2 !== undefined && password !== "" && password2 !== "") { //if password matches and is defined we console.log success message and register the user console.log("The passwords match!"); wixUsers.register(email,password) .then(()=>{ wixLocation.to('/registreren'); }) } //if password are not defined console.log error message else if (password === undefined | password2 === undefined | password === "" | password2 ==="") { console.log("The passwords are not defined"); $w('#passworderror').show(); } //if passwords do not match console.log error message else { console.log("The passwords do not match!"); $w('#passworderror').show(); } }); })
I have myself not spotted any errors in the code, so I am a bit at a loss why some users experience problems clicking on the 'volgende' (Eng.: next) button.
Best regards,
Chiel Buseyne
Having waited unfruitfully for an answer for quite some time, I decided to drop the register API from my code. So never mind my question anymore. I hope however that you not that the register API is buggy and that it ought to be fixed.
Can someone please have a look into this.
Dear @Yisrael,
Dear other wix experts
Concerning the following page: https://www.vocap.info/signup
I removed the reference to the headerdataset in my site code just to be sure, although it it only threw an error in preview mode. I added further console.log() statements and checked this as well, but did not find anoy more errors. However, the issue seems to persist. Specifically the issue is the following for users that are not logged in:
- The code does not always register the user in the member list as it should and then gets stuck or continues without registering in the member list.
- The then(() statement is not always executed. It is executed with about 8 out of 10 users. It should always be executed, as a user can only register in the member list once and they need to continue to the next page.
- As stated, many users don't have problems. I myself was unable to simulate the problem.
What could be causing this?
This is really giving me a hard time, so I hope you will be able to guide me.
wixUsers.register(email,password) .then(()=>{ wixLocation.to('/registreren') }) }
Kind regards,
Chiel Buseyne
Dear @Yisrael,
Is this the correct way to do it?
import wixUsers from 'wix-users'; import wixLocation from 'wix-location';
$w('#register').onClick(function (){ let email = $w('#email').value; let password = $w('#password').value; let password2 = $w('#password2').value;
//...
Best regards,
Chiel Buseyne
Hey Chiel,
Your page has two onReady() functions which is invalid. Only one (the last) is recognized. This will definitely cause problems.