Reputation: 22370
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.
Upvotes: 0
Views: 346
Reputation: 1532
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.
Upvotes: 0
Reputation: 67175
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.
Upvotes: 6
Reputation: 1187
you should look toward ajax technology in javascript to store the number of votes without page refresh.
Upvotes: 0