Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7787845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:48:04+00:00 2026-06-01T20:48:04+00:00

I am trying to implement a ratings plugin. I am able to get the

  • 0

I am trying to implement a ratings plugin. I am able to get the ratings plugin to work fine. I am trying to extend it. So each time the rating is clicked it puts the label under the rating itself. Currently it binds to a css id elsewhere on the page.

The scenario is a twitter message and cant seem to get a selector to update on the message itself. It puts the message on all of them because its not unique.

How can I make the item unique. The documentation for the plugin is http://rateit.codeplex.com/documentation.

 $(document).ready(function () {

      //we bind only to the rateit controls within the products div

      $(".rateit").bind('over', function (event, value) { $(this).attr('title', value); });
      $(" .rateit").bind('rated reset', function (e) {

          var ri = $(this);

          //if the use pressed reset, it will get value: 0 (to be compatible with the HTML range control), we could check if e.type == 'reset', and then set the value to  null .
          var value = ri.rateit('value');
        var ratingid = ri.data('ratingid');           



          //maybe we want to disable voting?
          ri.rateit('readonly', true);

          $.ajax({
              url: '/Home/GetRating', //your server side script
              data: { id: ratingid, value: value }, //our data
              type: 'POST',
              success: function (data) {
                  $('#ratemsg').html(data);

              },
              error: function (jxhr, msg, err) {
                  $('#response').append('<li style="color:red">' + msg + '</li>');
              }
          });
      });

  });

</script>

 @foreach (var item in Model)
{ 
 <div id="TwitterMessageBox@(item.StatusId.ToString())" class="TwitterMessageBox">

    <ol>
        <li class="TweetLineBody">
            @Html.Hidden("Statusid", item.StatusId)
            <div class="TwitProfileImage">
                <img src=@Url.Content(item.ImageUrl) alt="@item.ScreenName" />
            </div>
            <div class="TwitRealName">
                @item.User
            </div>
            <div class="TwitNickName">
                @MvcHtmlString.Create(@Html.Namify(@item.ScreenName))
            </div>
            <div class="TweetText">
                @MvcHtmlString.Create(@item.Tweet)</div>
            <div class="TweetTime">
                @Html.RelativeDate(@item.Created)</div>

            <div id="TweetMessageRating@(item.StatusId.ToString())" name="TweetMessageRating@(item.StatusId.ToString())"  class="TweetRating">

               // This is where the rating widget goes and records and updates              
                <div data-ratingid="@item.StatusId"   class="rateit"></div>
         // this is where i want to go but i cant figure out a way
                 <span id ="ratemsg" name="TweetRating@(item.StatusId.ToString())"  class="ratemsg"> </span>
             </div>

        </li>
    </ol>

  </div>
 }

As you can see above, I am trying to set a unique key by adding the message id which is a status id to the selector but I can’t seem to select it using wildcards. I tried some of the examples on the jquery site and I just can’t seem to get it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:48:06+00:00Added an answer on June 1, 2026 at 8:48 pm

    Instead of using an id, just save the sibling of the current .rateit element.

    var ri = $(this),
        msg = ri.next();
    
     ...
    
        success: function (data) {
            msg.html(data);
        },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying (still) to get ajaxful-rating to work with my rails installation. I did
Trying to implement a rating system of users and postings. What is the best
im trying to implement a custom error page, what i want to be able
Trying to implement search with Sunspot Gem wich is using Solr.Fulltext search works fine
Trying to implement NSCopying for the first time, and I have a question about
I'm trying to implement the Star Rating Widget with 5 stars split in half,
Trying to implement AVAudioplayer and get some metering data of the played music, but
I am trying to implement a rating system where I keep the following two
Trying to implement a UITableView of names similar to the built-in Contacts iPhone app
While trying to implement an MVC file upload example on Scott Hanselman's blog. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.