Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

5-Star Rating reading from DB

Posted on 2009-05-16
4
291 Views
Last Modified: 2012-05-07
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
Comment
Question by:potworny
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:pedro_sland
ID: 24402457
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
 

Author Comment

by:potworny
ID: 24402466
Hi pedro_sland,

If I do that the value is sent to DB using predefined callback function.
0
 
LVL 2

Accepted Solution

by:
pedro_sland earned 500 total points
ID: 24402900
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
 

Author Closing Comment

by:potworny
ID: 31582211
Thank you for your comment :)
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show confirmation alert in Jquery 14 71
Jquery GMAP3 Hierarchy 1 35
JqueryUI sortable append variable to post 1 46
Javascript_Set_dropdown_value 7 40
Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question