Question

I am trying to create vote up and down arrows similar to what exists here on Stack Overflow. Ideally I'd like to have them interact dynamically with a piece of text recording the number of votes, just as they do on Stack Overflow.

Was it helpful?

Solution

Unless there's some trick I hadn't considered, I'd think you'd need to create a many-to-many relationship between users and the items being voted on.

Every time someone votes up or down, you'd add a record to the joining table. This is the only way I see to track which user has already voted and be able to track both the number of up and down votes--like stackoverflow does.

OTHER TIPS

you should look toward ajax technology in javascript to store the number of votes without page refresh.

Not enough with jQuery + HTML only. You need extra ingredients like PHP and MySQL to save the votes.

Example how to make voting system with jQuery, PHP & MySQL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top