How to record which user clicked a button/poll

My friend and I are designing a sports-themed website, and we want to add a feature that allows you to click a button and “vote“ for who will win a particular matchup, but we are having difficulty tracking which specific user clicks a button instead of just general responses.

The ultimate goal is to allow players to click whatever team they prefer and allow us to track responses so we can reward correct answers after games are played.

If anyone has knowledge on how to do so, it’d be greatly appreciated.

Shouldn’t be a big deal.

  1. When someone clicks the BUTTON, get the current logged-in member-data, like(member-ID) into your DATABSE.

  2. Inside your database you will have related FIELDs where you memorize all the clicks.

$w.onReady(()=>{
$w(‘#myButtonIDhere’).onClick(()=>{

	//check if user is logged in... 

https://www.wix.com/velo/reference/wix-members/authentication/loggedin
//get the member-Data…
https://www.wix.com/velo/reference/wix-members/currentmember/getmember
//save wished data to your own DATABASE…
https://www.wix.com/velo/reference/wix-data/save
});
});

Just a little example of how to do. Of courssse you will have to think about more functionalities, like → what if a user clicks again ang again the BUTTON, what should happen, and so on…