473,320 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

star rating system

pradeepjain
563 512MB
I have a small problem . I want to build a rating system where in a user rates 5-6 features of a product . i don't want to update the server database on each click of the product feature but after he has done with all the feature rating he should be able to submit!!! i have problem in generating this stars ...i need to highlight say 1-3 stars when 3rd star is clicked and how do i pass the value when updating .... i use php as server side scripting!!!!
Oct 26 '09 #1
4 2623
acoder
16,027 Expert Mod 8TB
The first problem is the highlighting. When one is clicked, loop over the stars to change the image src property until it reaches the clicked one, e.g.:
Expand|Select|Wrap|Line Numbers
  1. for (i = 0; i < num; i++) {
  2.     document.getElementById("feature1star"+i).src = '...';
  3. }
Oct 26 '09 #2
pradeepjain
563 512MB
you mean to say change the class so as to make it highlighted !!!

second problem how will i set a value for each star and pas sit through the form ?
Oct 26 '09 #3
acoder
16,027 Expert Mod 8TB
Well, change the class or the image source, whatever suits you. Have two images: one normal (blank star) and one highlighted.

To pass the value, it depends on your server-side script. However, you only need to pass 5/6 values and all of them will be numbers, so, for example:
Expand|Select|Wrap|Line Numbers
  1. "url.php?feature1="+encodeURIComponent(feature1rating) + ...
and so on.
Oct 26 '09 #4
pradeepjain
563 512MB
http://www.fyneworks.com/jquery/star.../#tab-Overview


I found this jquery plugin useful.
Nov 4 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: jeremy | last post by:
this is probably a simple sql solution, but i could use some help. i've got one table that has rows of documents, and another table with any number of ratings for each of the documents. The rating...
0
by: soma | last post by:
I have a rating system on a forum I'm building. Users can rate a topic either good or bad. For each Good rating, one point is added to the topic's score. For every Bad rating, one point is subtracted...
8
by: kp87 | last post by:
I am a little bit stuck .... I want to play a bunch of soundfiles randomly, but i want to give each soundfile a rating (say 0-100) and have the likelihood that the file be chosen be tied to its...
2
by: Brian | last post by:
Hi - Does anyone know how Netflix manages its star rating system? The javascript is either computer generated or obfusicated. It's more trouble to reverse engineer than it's worth. I'm not...
2
by: Baron Samedi | last post by:
I am looking for a simple rating script whcih does not require SQL. Thanks in advance for any help.
0
by: Ben Butschko | last post by:
Hi @all! I've got a little problem: I want to use a Star Rater Script (CSS Design) for an Voting Formular. http://komodomedia.com/blog/samples/ratings.htm The values can be written via...
3
by: cbtube03 | last post by:
Is there a package rating system for the Cheese Shop, like how Perl has cpanratings (http://cpanratings.perl.org/)? Do you think it would be useful? I see that we already have Cheesecake...
5
by: gubbachchi | last post by:
Hi, I need to store the star rated values in mysql. How will I do it. This is the code I have used to create the star rater, <ul class="star-rating small-star"> <li class="current-rating"...
4
by: MissElegant | last post by:
Hi every body I wanna find someone in here who'd create me a 5-star rating system for my website using Javascript. The script should accept the rating a user made and place a cookie on the...
1
pradeepjain
by: pradeepjain | last post by:
Hii guys , I have several products in my mysql database and i wanna allow the authorized users to rate the products !! i am clear till this point like it has to be done with the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.