65.9K
CodeProject is changing. Read more.
Home

Simple rating control using jQuery

starIconstarIconstarIconstarIcon
emptyStarIcon
starIcon

4.06/5 (44 votes)

Dec 4, 2012

CPOL
viewsIcon

62343

downloadIcon

4986

A jQuery rating control.

503495/demo.gif

How to use

  1. Include the necessary JS and CSS files.
  2. <script type="text/javascript" src="rating.js"></script>
    <link rel="stylesheet" type="text/css" href="rating.css" />
  3. Create a text box element (the class "rating10" contains a num "10", this will display 10 starts).
  4. <input type="text" class="rating rating10" />
  5. Fire plug-in using jQuery selector.
  6. $(function ()
    {
        $('.rating').rating();
    });
  7. When form submits, you can access these values in the server-side script using $_POST (PHP), Request.Form (ASP or ASP.NET).