Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / HTML

Simple rating control using jQuery

4.06/5 (48 votes)
4 Dec 2012CPOL 62.3K   5K  
A jQuery rating control.

503495/demo.gif

How to use

  1. Include the necessary JS and CSS files.
  2. XML
    <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. XML
    <input type="text" class="rating rating10" />
  5. Fire plug-in using jQuery selector.
  6. JavaScript
    $(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).

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)