PDA

View Full Version : Make Star Rating Required?


Kingsrealm
05-04-2009, 01:59 PM
Is there any way to make the star rating a required input?

We are finding it is often overlooked...

For instance on Yelp you can't submit unless you have given a star rating of at least 1 star.

nickmattern
05-04-2009, 02:02 PM
We'll add that to the discussion board for version 3. Good idea!

wescleveland
06-26-2009, 01:05 PM
In the mean time, I just added this little script to my comments.php (right before the <form>):

<script type="text/javascript"><!--
function validateRatings() {
for(i = 1; document.getElementById('rating_' + i); i++) {
if(document.getElementById('rating_' + i).value == 0) {
alert('Please rate this product before submitting your review.')
return false;
}
}
return true;
}
//--></script>

and then modified the <form> to include onSubmit="return validateRatings()"

Admin
06-26-2009, 11:23 PM
Sweet I'll see about getting that into the next version -- need to start thinking seriously about that.

Raphael