View Single Post
Old 02-26-2008, 04:57 PM   #5 (permalink)
dschreck
The Contributor
 
dschreck's Avatar
 
Join Date: Nov 2007
Location: California
Posts: 82
Thanks: 0
dschreck is on a distinguished road
Default

When I created mine, I compared how long it would take me to write all of the cross browser javascript, and how much less time it'd take me just to take a premade 'star rating' widget and mod it out. I went with one form jQuery, as it offered the easiest to modify code.

The PHP is obviously very straight forward, it's just handling POST data.

But what I recommend to you and to anyone else who wishes to create their own versions of things like this, take a look at what's out there.

Just because you want to make your own, doesn't mean you shouldn't take a peak and see how everyone else did it.

It's great to learn from trying it yourself, but if you haven't the slightest idea on where to start, that should give you a good footing.

The basics of how this works:
You can split them up into single stars, or half stars. Or you can use bars or whatever.
Basically, you have an array of all stars, wherever the user puts their mouseover, you count how many are below it, and switch them 'on'. And just undo that action for turning them off. You will need to save the original state for easy resets. onclick for any of them will kick off the Ajax wrapper, which sends post, comes back, and lets you know it was saved. and then lock the stars.

Hope that helps.
dschreck is offline  
Reply With Quote