Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 299
  • Last Modified:

5-Star Rating reading from DB

Hi Experts :)

I am trying ot use the JQuery 5-Star Rating Plugin
http://www.fyneworks.com/jquery/star-rating/#tab-Testing

Everything goes just fine besides one thing. I want to click "Read Rating From DB" button, check the DB and present the new value using a star-rater that is already there (ex. change the rating from 3 to 5).

I don't know how to dynamically create/change the stars value. Has anyone managed to do that?

Hope to see some help here :),
The Terrible
<input name="star2" type="radio" class="star"/> 
<input name="star2" type="radio" class="star"/> 
<input name="star2" type="radio" class="star" checked="checked"/> 
<input name="star2" type="radio" class="star"/> 
<input name="star2" type="radio" class="star"/>

Open in new window

0
potworny
Asked:
potworny
  • 2
  • 2
1 Solution
 
pedro_slandCommented:
Use javascript to call something like the following to select the 3rd star (0 is the first star).

$('rating selector').rating('select', 2);

Open in new window

0
 
potwornyAuthor Commented:
Hi pedro_sland,

If I do that the value is sent to DB using predefined callback function.
0
 
pedro_slandCommented:
The easiest way would be to have a global variable that is set to true before the 'select' is manually called and then ignore it in the callback function and reset the global variable to eg false.
0
 
potwornyAuthor Commented:
Thank you for your comment :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now