Hi, I’m Leo. I want my users to be able to fill out a form only once. For example, if they try to fill out the form with an email already used to fill out that form, a message such as “email already used” appears
Hello Leo,
you can achieve your aim if you do the following setup…
- creating a database which will store all already used/submitted emails from your submission-form.
2)needed database-fields would be …
- email
-user-ID
- The Flow of your function would be
-press Submission-button
-starting a check-process to look for already existing values
-saving-process to DB if no existing values found.
This way a user would be able to do a submission with same values only once.
Thank you very much, but having never worked with codes would you be able to give me a hand?
Well, di you already complete STEP-1. You have already a good structured database, with all needed DB-Fields inside?
Show a Screenshot of your DB
I see this code on an another forum post, it is right?
import wixUsers from ‘wix-users’;
$w.onReady( function () {
if (wixUsers.currentUser.loggedIn) { let user = wixUsers.currentUser; console.log(user); user.getEmail() .then((email) => { let userEmail = email; console.log(userEmail); }) } })