akhanisatyammg / jquery-star-rating-plugin

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

Split display problem. shows 20 stars instead of 5 split:4 stars. #93

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. use code provided below in a .php

What is the expected output? What do you see instead?
I expected to see the split stars rating with only five stars showing.
Instead, it shows 20 stars and checks the one at 4.00 rating

What version of the plugin/jQuery are you using?
PLUGIN VERSION: v3.14 (2012-02-08)
JQUERY VERSION: v1.5

On what browser(s) or operating system?
BROWSER(S): Chrome

Please provide a link to where the problem can be observed:
URL: 
http://www.skpacman.com/infusions/code_snippets_panel/star_rating_issue_public.p
hp?snip=17#comments

Feel free to provide any additional information below.

Below is the code being used to display the stars in php.

//rounded average is actually calculated, I set a value for it here just for 
testing.
$rounded_average = "4.25";
echo "Avarage Rating: (2)&nbsp;&nbsp;".$rounded_average."<br />";
//Rounded Average Star View // ROUNDED TO .25
    echo "<form style='display:inline;' name='displayrating'>";
    echo "<input name='star' type='radio' value='0.25' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '0.25'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='0.50' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '0.50'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='0.75' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '0.75'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='1.00' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '1.00'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='1.25' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '1.25'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='1.50' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '1.50'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='1.75' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '1.75'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='2.00' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '2.00'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='2.25' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '2.25'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='2.50' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '2.50'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='2.75' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '2.75'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='3.00' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '3.00'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='3.25' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '3.25'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='3.50' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '3.50'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='3.75' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '3.75'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='4.00' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '4.00'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='4.25' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '4.25'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='4.50' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '4.50'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='4.75' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '4.75'){ echo "checked='checked'";} echo "/>";
    echo "<input name='star' type='radio' value='5.00' class='star {split:4}' disabled='disabled' "; if ($rounded_average == '5.00'){ echo "checked='checked'";} echo "/>";
    echo "</form>";

Original issue reported on code.google.com by skpacman...@gmail.com on 16 Mar 2012 at 6:25

GoogleCodeExporter commented 8 years ago
I checked the code and it also happens on jquery 1.7.1

something is wrong with how your php code is formed.

Original comment by Stephen....@symcom.com on 16 Mar 2012 at 6:34

GoogleCodeExporter commented 8 years ago
The PHP looks fine (presumably). The problem is that you don't have the 
matadata plugin!

you can do this:
class="star {split:4}"
...only if you have the metadata plugin.

OR do this...
class="star split-4"
...if you don't have it.

I recommend you use the metadata plugin (included in the download package).

Original comment by diego.a...@gmail.com on 16 Mar 2012 at 7:02

GoogleCodeExporter commented 8 years ago
Yep. I just noticed that shortly after posting here.

All fixed. Thanks for your input.

Original comment by skpacman...@gmail.com on 16 Mar 2012 at 7:16