Hey all,
Building an online school and i would like my community to vote for the next course out of the available option. Each option is a single strip with course description.
Looking to create a +1 icon or a heart icon that user could vote for the course they want to see next.
Also - would like to show how many people voted for this course.
How is this possible with Wix code?
Thanks,
Gil
It’s possible, but maybe you’d like to have a look at Wix App market, they have some “poll” apps, and maybe it can save you time (I’m not really familiar with these apps, you should add and try).
This should help you get started if you want to code it yourself.
https://www.vorbly.com/Vorbly-Code/WIX-REPEATERS-LIKE-BUTTONS-FOR-COMMENTS
Tried them all None have a “Like” button that is not social connected
This is great, Thanks.
This code shows NaN when i click the like button. And seems it does’nt record value in database.
Take a look at these examples:
Thanks. database is working now but on first click on heart/like button shows “NaN” as the like text.
$w(‘#counter’).text = String(like+1);
this line of code results “NaN” text on first click. After refreshing page and then clicking the like button for second time shows the value 1.
I referred this link to make the “like” module :
https://www.vorbly.com/Vorbly-Code/WIX-REPEATERS-LIKE-BUTTONS-FOR-COMMENTS
That is because NaN stands for Not a Number or basically null.
The first time you run the review you are not having any numbers to compare it with, however after your refresh of the page the dataset will then contain a number that the code can work from.
https://stackoverflow.com/questions/2618059/in-java-what-does-nan-mean
Okay Thanks. I define null value as zero. Now its working perfectly
export function ifNull(a){ return (a===undefined) ? 0 : a; }
Great idea, although in theory that should only have to come into effect when you are the first to use the ratings and reviews yourself.