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

  • Home
  • SEARCH
  • 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 6167701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:33:30+00:00 2026-05-23T22:33:30+00:00

We are using a jquery star rating script which is what we want exactly.

  • 0

We are using a jquery star rating script which is what we want exactly. We are trying to create a feature to work along side with it but it isn’t working due to the radio buttons being replaced?

This is what we have:
enter image description here

This is what we want to achieve:

enter image description here

Basically, what we are trying to do is create a feature that updates a percentage depending on what they chose, a “score” type of thing. It works perfectly if we take the rating script out – as it just runs straight from the radio buttons – but when we use the rating script, the radio buttons get replaced by just DIVs. When inspecting with firebug, we see the following:

<div class="ui-stars-star">
    <a title="">Average</a>
</div>

Which in pure HTML, is infact:

<label for="vote-19_5" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_5" value="Average" /> Average</label>

Here is our code:

An example rating:

<div class="ctrlHolder">
    <p class="label">Clean Green and Environmentally Friendly</p>
    <div class="multiField starify" id="question-19">
        <label for="vote-19_1" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_1" value="Very Poor" /> Very Poor</label>
        <label for="vote-19_2" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_2" value="Poor" /> Poor</label>
        <label for="vote-19_3" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_3" value="Not that Bad" /> Not that Bad</label>
        <label for="vote-19_4" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_4" value="Fair" /> Fair</label>
        <label for="vote-19_5" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_5" value="Average" /> Average</label>
        <label for="vote-19_6" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_6" value="Almost" /> Almost</label>
        <label for="vote-19_7" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_7" value="Good" /> Good</label>
        <label for="vote-19_8" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_8" value="Very Good" /> Very Good</label>
        <label for="vote-19_9" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_9" value="Excellent" /> Excellent</label>
        <label for="vote-19_10" class="blockLabel"><input type="radio" name="poll-19" id="vote-19_10" value="Perfect" /> Perfect</label>
    </div>
</div>

Here is where we want our feature to go:

Score: <div id="rating"></div>

Here is our JS to create the feature:

$('.starify :radio').live('click', function(){
var rating=0;
$('.starify :checked').each(function(){
rating += ($(this).parent().index()+1) * 0.5;
});

$('#rating').text(rating + ' %');
});

We just want to get our rating score % feature compatible with the star rating script, as the star rating script replaces the radio buttons with HTML and it causes the score % JS not to work. If we take out the star rating script, it works perfectly. (I can upload a demo of that too if needed).

We don’t even mind setting in our javascript variables, to define each word as a numeric value.

Demo: http://sitehelp.com.au/demos/starrating/demo7c.html

Any help would be greatly appreciated.

  • 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-05-23T22:33:31+00:00Added an answer on May 23, 2026 at 10:33 pm

    how about something like this?…

    $('.ui-stars-star').live('click', function(){
    var rating=0;
    $(this).parent().find(".ui-stars-star-on").each (function ()
    {
      rating += ($(this).parent().index()+1) * 0.5;
    });
    alert(rating);
    
    });
    

    we can even make it better by removing the loop:

    $('.ui-stars-star').live('click', function(){
       var rating=0;
    
       rating = $(this).parent().find(".ui-stars-star-on").length * ($(this).parent().index()+1) * 0.5;
    
       alert(rating);
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using jQuery, how would you find elements which have a particular style (eg: float:
Using jQuery , how can I dynamically set the size attribute of a select
Using jQuery, how do you bind a click event to a table cell (below,
Using jQuery, how do you check if there is an option selected in a
Using jquery how do I focus the first element (edit field, text area, dropdown
Using jQuery, what's the best way to find the next form element on the
Using jQuery, is there a way to select all tag that reference a specific
Using jQuery, how do I delete all rows in a table except the first?
When using jQuery 's ajax method to submit form data, what is the best
I'm using jQuery and SimpleModal in an ASP.Net project to make some nice dialogs

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.