Feedback

I am trying to use this jQuery star rating plugin: http://www.fyneworks.com/jquery/star-rating/#tab-Overview . I am trying to get the star value after clicking, but I have no luck. I was not sure where to include the following callback that they offer:

$('.auto-submit-star').rating({ callback: function(value, link){ alert(value); } }); 

I tried sticking to it in code, but I don't get a warning when I click the asterisk. Thanks!!

+4
source share
6 answers
 $(function(){ $('input[type=radio].star').rating(); }); 

Remove the specified lines from jquery.rating.js and you are all set up. I suppose I don’t need to explain why, since it is intuitive =)

+5
source

You need to change the class on the switches from star to auto-submit-star , not just add auto-submit-star to the existing star class on the switches. For example, mine looks like this:

 <input name="star1" type="radio" class="auto-submit-star" value="1"/> 
+3
source

Did you give your switches the class name auto-submit-star ?

 <input type="radio" name="whatever" class="auto-submit-star" /> 

$('.auto-submit-star') selects all switches with the class auto-submit-star , and then sets up the rating plugin.


On the other hand, it seems that you can do this before the DOM ready . If you do not know what it is:

 jQuery(document).ready(function() { $('.auto-submit-star').rating({ callback: function(value, link){ alert(value); } }); }); 
+1
source

https://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=21 refer to the following: You must use a selector other than ".star"

+1
source

Open the browser developer tools and look at the console log; are there any warnings or error messages? If yes, something is wrong in your code. Otherwise, Jospeh's answer is most likely correct, and your selector ( $('.auto-submit-star') ) doesn't select anything.

0
source

Although this is a very old POST, but my experience can help someone. I had the same problem too. but able to solve it after generating the code via Ajax, and then with the success callback I turned on the evaluation plugin. It worked for me. I think it does not detect a class created on the DOM.

0
source

All Articles