I've been trying to use this jquery star rating plugin: http://www.fyneworks.com/jquery/star-rating/#tab-Overview. I'm trying to get the value of the star once it's clicked but I've been having no luck. I wasn't sure where to include the following callback they suggest:
$('.auto-submit-star').rating({
callback: function(value, link){
alert(value);
}
});
I've tried sticking it around in the code but I get no alert when I click a star. Thanks!!
$(function(){
$('input[type=radio].star').rating();
});
Remove the above lines from the jquery.rating.js, and you are all set. I suppose I don't need to explain why as it's intuitive =)
You need to change the class on the radio buttons from star
to auto-submit-star
, don't just add auto-submit-star
to the existing class of star on the radio buttons. For example mine looks like this:
<input name="star1" type="radio" class="auto-submit-star" value="1"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With