top of page
Forum Posts
Ben G
Sep 20, 2020
In Coding with Velo
Hi. I have a custom registration form set up and what to display an error message is a registered user try's to register again. Below is the code I have however I can't get it to work. I have the text error message hidden on load. Any help as to where I am going wrong or what I am missing would be appreciated. Thanks! Code: import wixUsers from 'wix-users';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
$w.onReady(function() {
$w('#registerButton').onClick(function (){
let first = $w("#firstName").value;
let last = $w("#lastName").value;
let email = $w("#email").value;
let password = $w("#password").value;
wixUsers.register(email, password,{
contactInfo: {
"firstName": first,
"lastName": last
}
})
.then((result) => {
wixLocation.to("/confirmation");
})
.catch((err) => {
let errorMsg = err;
console.log(errorMsg);
$w('#emailExists').expand();// You can delete this line if you are not going to add an error message. Use a regular text element set to 'collapse on load' from the Properties Panel.
});
})
})
1
1
242
Ben G
Aug 23, 2020
In Coding with Velo
Hi. I have a database set up and connected to a form. All working perfect. The issue I have is one of the fields on the form is a payment field (url) where the user enters their PayPal url. When the user enters the payment url they have to enter the full url https://www.paypal.me/userid. The problem is most users just enter www.paypal.me/userid and forget to enter the https:// which means the button on the frontend profile does not work. I believe if I add a beforeinsert hook I can either add the https:// or https://www.paypal.me/ in front of what the user has entered. This would then only require the user to enter their PayPal handle. I have looked at examples of beforeinsert code however cannot find any example that shows how to add in front of what the user entered. I can find how to replace what the user entered but that is not what I need. Any help would be greatly appreciated. Thanks in advance.
0
0
27
Ben G
More actions
bottom of page