top of page
Forum Posts
EggWebTut
Nov 08, 2021
In Coding with Velo
Hi. I just noticed there is an API called wix-members. What’s the difference between the wix-members API and the wix-users API?
0
3
38
EggWebTut
Nov 07, 2021
In Coding with Velo
Hi. Is there any way I can practice the Velo certification test?
0
1
356
EggWebTut
Oct 28, 2021
0
4
301
EggWebTut
Oct 28, 2021
In Coding with Velo
I added this code so that people could change their profile pictures. But it has an error. What did I do wrong?
0
2
26
EggWebTut
Oct 26, 2021
In Coding with Velo
I made this registration lightbox but it's not working. What did I do wrong? import wixWindow from 'wix-window';
import wixUsers from 'wix-users';
import {fetch} from 'wix-fetch';
import wixData from 'wix-data';
$w("#firstName").inputType = "text";
$w("#lastName").inputType = "text";
$w("#username").inputType = "text";
$w("#email").inputType = "email";
$w("#confirmEmail").inputType = "email";
$w("#password").inputType = "password";
$w("#confirmPassword").inputType = "password";
export function loginRedirect_click(event) {
wixWindow.lightbox.close('Sign up');
wixWindow.openLightbox('login');
}
export function closeWindow_click(event) {
wixWindow.lightbox.close('Sign up');
}
let ipAddress;
let ipCountry;
$w.onReady(function (){
getUserIP();
});
function getUserIP(){
fetch('https://extreme-ip-lookup.com/json', {
method: 'get'
}).then((httpResponse) => {
if(httpResponse.ok){
return httpResponse.json();
}
}).then((json) => {
ipAddress = json.query;
ipCountry = json.country;
});
}
export function register_click(event) {
$w("#message").text = "Please wait..."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #000000;'>" + value + "</p>";
$w("#register").disable();
let emails = [];
emails.push()
wixUsers.register($w("#email").value, $w("#password").value,
{
"contactInfo": {
"firstName": $w("#firstName").value ,
"lastName": $w("#lastName").value ,
"emails": emails
}
}).then(() => {
let rand = Math.random() .toString(36) .substr(2,3);
let hours = Math.round(Date.now() / 1000 / 60 / 60)
let generatedId = rand.toString() + hours.toString();
console.log (generatedId);
let toInsert = {
"_id": wixUsers.currentUser.id,arguments,
"email": $w("#email").value,
"peopleId": "x",
"firstName": $w("#firstName").value,
"lastName": $w("#lastName").value,
"username": $w("#username").value,
"phoneNumber": $w("#phoneNumber").value,
"password": $w("#password").value,
"organization": $w("#organizationCheckbox").checked,
"emailVerify": "x" ,
"country": ipCountry,
"ipAddress": ipAddress,
"profilePicture": 'https://static.wixstatic.com/media/feefcb_fbf50c3aad234b21a9b07c783f5a59b8~mv2.jpg'
}
wixData.insert("Members", toInsert)
.then(() => {
$w("#message").text = "Your account has been created!"; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #B1D3BB;'>" + value + "</p>";
setTimeout(loginRedirect_click, 2000);
}).catch((err) => {
$w("#message").text = "An error occured. Please try again later."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #FF4040;'>" + value + "</p>";
})
})
}
function doChecks(){
wixData.query("People")
.eq("username", $w("#username").value)
.limit(1)
.find()
.then((results) => {
if(results.items.length > 0) {
$w("#message").text = "There is already a member with this username. Please enter a different username."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #FF4040;'>" + value + "</p>";
$w("#register").disable();
} else if($w("#username").value.length < 2 || $w("#username").value.length > 20){
$w("#message").text = "Username can't be less than 2 characters or more than 20 characters."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #FF4040;'>" + value + "</p>";
$w("#register").disable();
} else if($w("#firstName").value.length > 50){
$w("#message").text = "First name can't more than 50 characters."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #FF4040;'>" + value + "</p>";
$w("#register").disable();
} else if($w("#lastName").value.length > 50){
$w("#message").text = "Last name can't more than 50 characters."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #FF4040;'>" + value + "</p>";
} else if($w("#email").value.length > 50){
$w("#message").text = "Email can't more than 50 characters."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #FF4040;'>" + value + "</p>";
} else if($w("#email").value !== $w("#confirmEmail").value){
$w("#message").text = "Email and confirm email don't match."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #FF4040;'>" + value + "</p>";
$w("#register").disable();
} else if($w("#password").value !== $w("#confirmPassword").value){
$w("#message").text = "Password and confirm password don't match."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #FF4040;'>" + value + "</p>";
} else if($w("#password").value.length < 2 || $w("#password").value.length > 20){
$w("#message").text = "Password can't be less than 2 characters or more than 20 characters."; $w("#message").show();
let value = $w("#message").text;
$w("#message").html = "<p style='font-size: 14px; font-style: helvetica; text-align: right; color: #FF4040;'>" + value + "</p>";
$w("#register").disable();
} else {
$w("#register").enable();
$w("#message").hide();
}
})
}
export function firstName_keyPress(event) {
clearTimeout(doChecks); setTimeout(doChecks, 2000)
}
export function lastName_keyPress(event) {
clearTimeout(doChecks); setTimeout(doChecks, 2000)
}
export function username_keyPress(event) {
clearTimeout(doChecks); setTimeout(doChecks, 2000)
}
export function email_keyPress(event) {
clearTimeout(doChecks); setTimeout(doChecks, 2000)
}
export function confirmEmail_keyPress(event) {
clearTimeout(doChecks); setTimeout(doChecks, 2000)
}
export function password_keyPress(event) {
clearTimeout(doChecks); setTimeout(doChecks, 2000)
}
export function confirmpassword_keyPress(event) {
clearTimeout(doChecks); setTimeout(doChecks, 2000)
}
export function phoneNumber_keyPress(event) {
clearTimeout(doChecks); setTimeout(doChecks, 2000)
}
export function organizationCheckbox_change(event) {
if($w("#organizationCheckbox").checked === true){
$w("#username").placeholder = "Organization Name"
} else {
$w("#username").placeholder = "Username"
}
}
export function seePassword_click(event) {
$w("#password").inputType = "text";
$w("#seePassword").hide();
$w("#hidePassword").show();
}
export function hidePassword_click(event) {
$w("#password").inputType = "password";
$w("#hidePassword").hide();
$w("#seePassword").show();
}
export function seePassword2_click(event) {
$w("#confirmPassword").inputType = "text";
$w("#seePassword2").hide();
$w("#hidePassword2").show();
}
export function hidePassword2_click(event) {
$w("#confirmPassword").inputType = "password";
$w("#hidePassword2").hide();
$w("#seePassword2").show();
}
0
6
59
EggWebTut
Oct 26, 2021
In Coding with Velo
I added a logout button to my website. But for some reason, it is not working. Here is my code: The error says "Property 'then' does not exist on type 'void."
0
9
56
EggWebTut
Oct 17, 2021
In Coding with Velo
Is there any code I could use for people to be able to see their password in a registration page like the one highlighted on the image below?
0
3
42
EggWebTut
Oct 15, 2021
In Coding with Velo
import wixWindow from 'wix-window';
import wixUsers from 'wix-users';
import wixData from 'wix-data';
export function logInButton_click(event) {
wixWindow.openLightbox('login')
}
export function registerButton_click(event) {
wixWindow.openLightbox('Sign up')
}
export function profilePic_click(event) {
wixWindow.openLightbox('Sign up')
}
export function continueWithoutAccountButton_click(event) {
$w("#welcomeScreen").hide();
}
$w.onReady(() => {
if (wixUsers.currentUser.loggedIn) {
if (wixUsers.currentUser.loggedIn) {
$w("#welcomeScreen").hide();
} else {
$w("#welcomeScreen").show();
}
}
if (wixUsers.currentUser.loggedIn) {
let user = wixUsers.currentUser;
wixData.query("Members")
.eq("_id", user.id)
.limit(1)
.find()
.then((results) => {
$w("#shareSomething").placeholder = "What's new " + results.items[0].username;
$w.onReady(() => {
waitForLoading();
});
function waitForLoading() {
setTimeout(() => {
$w('#loadingScreen').hide('FadeOut');
}, 2000);
}
}
,$w.onReady(function () {
let user = wixUsers.currentUser;
wixData.query("Members")
.eq("_id", user.id)
.limit(1)
.find()
.then((results) => {
$w("#loginCheck").text = "Hello " + results.items[0].username;
function loginCheck() {
if (wixUsers.currentUser.loggedIn) {
$w("#star").hide();
let user = wixUsers.currentUser;
wixData.query("Members")
.eq("_id", user.id)
.limit(1)
.find()
.then((results) => {
$w("#loginCheck").text = "Hello " + results.items[0].username;
});
} else {
$w("#loginCheck").text = "Please log in.";
$w("#star").show();
}
} //there is an error here.
0
1
32
EggWebTut
Mar 22, 2021
In Coding with Velo
Hello. The Wix dark mode function doesn't work. When I add it to my website and then I publish it and then test it, when the dark mode switch is clicked, the text is white, but the background is not black.
0
4
47
EggWebTut
Mar 21, 2021
In Coding with Velo
I created a custom registration form and it doesn't work. What is wrong with it? Here is the code:
import wixUsers from 'wix-users';
import wixData from 'wix-data';
import wixLocation from 'wix-location';
import wixWindow from 'wix-window';
$w.onReady(function () {
$w('#registerButton').onClick( () => {
let emails = [];
// register as member using form data
wixUsers.register($w('#email').value, $w('#password').value, {
"contactInfo": {
"firstName": $w('#firstName').value,
"lastName": $w('#lastName').value,
let toInsert = {
"_id": wixUsers.currentUser.id,
"firstName": $w('#firstName').value,
"lastName": $w('#lastName').value
};
wixData.insert("Members", toInsert)
.then( (results) => {
let item = results; //see item below
} )
.catch( (err) => {
let errorMsg = err;
} );
/* item is:
*
* {
* "_id": "rifk4nrk-dj4o-djhe-oidk-fnoqw4oiglk4i",
* "_owner": "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb",
* "_createdDate": "2017-05-24T12:33:18.938Z",
* "_updatedDate": "2017-05-24T12:33:18.938Z",
* "title": "Mr.",
* "first_name": "John",
* "last_name": "Doe"
* }
*/
export function registerButton_click(event) {
.then(()=>{
wixLocation.to('/home');
}
.catch( (err) => {
let errorMsg = err; $w('#errorMsg').show();
}
});
});
});
export function login_click(event) {
wixWindow.lightbox.close('Register');
wixWindow.openLightbox('Login');
}
export function close_click(event) {
wixWindow.lightbox.close('Register');
} #custom #registration #form #forms #customregistration #customregistrationform
0
0
10
EggWebTut
Mar 12, 2021
In Tips, Tutorials, Examples
I am doing a YouTube premiere of displaying elements in mobile only. See it at https://www.youtube.com/watch?v=eQ1oxMZwc-A
#VelobyWix #DisplayingElementsInMobileOnly #Mobile #EggWebTut #YouTube #YT #Premiere #Video
0
2
71
EggWebTut
Mar 08, 2021
In Coding with Velo
I am creating a social networking website with Wix (Velo). And I want to add a page where members can video call each other. Is that possible? #socialnetworking #videocalling
0
2
56
EggWebTut
More actions
bottom of page