Page 1 of 1

image rating type thing?

Posted: Thu Mar 23, 2006 6:24 pm
by elecktricity
I have no clue how to do this, but I want were you can leave comments and in the comment theres 5 stars above it were you can rate it, I dont want radiobuttons I want it to be able to click which star you want and it to be in a variable when the form data is submitted kinda like this code below but I want the image to change colors like if you click the first one only the first star is litup, click the second star the second and first star is, and so on:

Code: Select all

<form action="vote.php" method="post">
<input type="radio" name="vote" value="1">1 star<br>
<input type="radio" name="vote" value="1">2 star<br>
<input type="radio" name="vote" value="1">3 star<br>
<input type="radio" name="vote" value="1">4 star<br>
<input type="radio" name="vote" value="1">5 star<br>
<textarea name="body"></textarea><br>
<input type="submit" value="Leave Comment">
</form>

Posted: Fri Mar 24, 2006 5:28 am
by pwhitrow
Hi,

I wrote a rating script quite recently that I think would be useful to you. It's radio buttons right now, but there is no reason why you could not change this to be just buttons (or input type=image to make it even better).

Take a look and feel free to play with.

http://www.gr0w.com/articles/code/php_5 ... g_hreview/

example: http://www.gr0w.com/articles/rater_example.php

Paul

Posted: Fri Mar 24, 2006 9:12 am
by elecktricity
im aware of knowing how to do that, but id like them to be able to click the star chart thing and set a variable, then type in a comment, then post them comment and add the score. I just dont know how to do the star part.