eddysilvamendes / jquery-star-rating-plugin

Automatically exported from code.google.com/p/jquery-star-rating-plugin
0 stars 0 forks source link

Dynamically changing rate for example, a selected picture #88

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Well I really does not have any steps, I have this script I try to use for 
assigning a value to the star control. with no success

    switch (rate) {
        case 1:
            $(".cal1").attr("checked", "checked");
            break;
        case 2:
            $(".cal2").attr("checked", "checked");
            break;
        case 3:
            $(".cal3").attr("checked", "checked");
            break;
        case 4:
            $(".cal4").attr("checked", "checked");
            break;
        case 5:
            $(".cal5").attr("checked", "checked");
            break;
        default:
I try this because the sample in the page is very tricky. Particularly I dont 
get the selector $('input', this.form). ANd I htink it doesnot suit my need. My 
inputs are like this:

<div id="stars" style="float: right;" onclick="SaveRate();">
  <input name="star1" type="radio" class="star cal1" value="1" />
  <input name="star1" type="radio" class="star cal2" value="2" />
  <input name="star1" type="radio" class="star cal3" value="3" />
  <input name="star1" type="radio" class="star cal4" value="4" />
  <input name="star1" type="radio" class="star cal5" value="5" />
</div>
I'm not using forms.

What is the expected output? What do you see instead?
I wnat to create the sript function I can invoke to set the value of the rate 
in the control. The age shows a coverflow of images and I wnat users to rate 
them. I Know when the coverflow is changing so I can get form DB and send to DB 
the rating, but I can not assign or refresh the control with new values.

What version of the plugin/jQuery are you using?
PLUGIN VERSION:3.13
JQUERY VERSION:1.6.2 from google

On what browser(s) or operating system?
BROWSER(S): Opera, Chrome, FF and IE, all tests are done in windows

Please provide a link to where the problem can be observed:
URL:

Feel free to provide any additional information below.
Thanks for the one who give me this push

Original issue reported on code.google.com by ricker.s...@asterysco.com on 1 Sep 2011 at 1:03

GoogleCodeExporter commented 8 years ago
I'm having a similar problem.  In my case, it is on a split: 4 disabled star.  
I tried making a fake form that is referenced in the same way.  This is bits of 
the code:

<form name="showstar">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled">
<input name="show-star" type="radio" class="star {split:4}" value="5" 
disabled="disabled" checked="checked">
</form>

Basically the rating in this one is the display of the average of all ratings 
on the picture.  Rating 1-5, just had the split to make the display more 
accurate.  After it is calculated, this is what is called:

function ratePage(rate) {
    bigRate = (rate * 4)-1;
    daForm = document.showstar;
  $('input',daForm).rating('select',bigRate); 
}

Nothing is changed.  Any thoughts?

Original comment by nephanor on 23 Jun 2012 at 2:41

GoogleCodeExporter commented 8 years ago

Original comment by diego.a...@gmail.com on 23 Feb 2013 at 5:12