Help With JQuery Star Rating.

This is a discussion on "Help With JQuery Star Rating." within the JavaScript Forum section. This forum, and the thread "Help With JQuery Star Rating. are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 18th, 2008, 15:10
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Help With JQuery Star Rating.

I'm trying to get the star query work in my PHP page.

Code: Select all
<?php
include('admin/database.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>The Best Flash Gallery</title>
<script src="jquery-latest.js" type="text/javascript" language="javascript"></script>
<script src="jquery.rating.js" type="text/javascript" language="javascript"></script>
<link type="text/css" rel="stylesheet" href="jquery.rating.css"/>
</head>
Am I missing a javascript src or something?

And this is bit with the form and the javascript.
Code: Select all
<body>
<script type="text/javascript">$(function(){ $('input[@type=radio].star').rating(); });</script>
<script>
$(function(){
 $('form').submit(function(){
  $('.test',this).html('');
  $('input',this).each(function(){ if(this.name!='') $('.test',this.form).append(''+this.name+': '+this.value+'<br/>'); });
  return false;
 });
});
</script>
<form method="post" action="">
<input class="star" type="radio" name="test-1-rating-2" value="1"/>
    <input class="star" type="radio" name="test-1-rating-2" value="2"/>
    <input class="star" type="radio" name="test-1-rating-2" value="3"/>
    <input class="star" type="radio" name="test-1-rating-2" value="4"/>
    <input class="star" type="radio" name="test-1-rating-2" value="5"/>
</form>
 
</body>
</html>
Is that all ok? I didn't quite understand the instructions here: http://www.fyneworks.com/jquery/star-rating/

I want to make it so I can submit the data to my database, which is very important.

Diego/others, assistance welcome please?
Do you want to see the entire page?

Cheers!
Jack
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote

  #2 (permalink)  
Old Feb 18th, 2008, 15:21
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: Help With JQuery Star Rating.

OK, my problem has changed. The question now is how to add it to the PHP while statement below?
PHP: Select all

while ($sites mysql_fetch_array($query)) {
$siteid $sites['site_id'];
$sitetitle $sites['site_title'];
$siteurl $sites['site_url'];
$siteimg $sites['site_img'];
$username $sites['user_name'];
$userurl $sites['user_url'];
$accepteddate $sites['accepted_date'];
$rating $sites['rating'];
$times_rating $sites['times_rated'];
$views $sites['views'];
echo 
'<div class="site">';
echo 
'<h3>' $sitetitle '</h3>';
if (
$siteimg == '') {
echo 
'<img src="noimgprovided.gif" alt="No Image Provided" height="140" width="140"  />';
} else {
echo 
'<img src=' $siteimg ' alt="' $sitetitle '" height="140" width="140" />';
}
echo 
'<p class="info">' $accepteddate ' || Designer: <a href="' $userurl '">' $username '</a> || Views: ' $views '</p>';
echo 
'<p class="rating">';
if (
$rating == 0) {
echo 
'Not Yet Rated';
} else {
$act_rating $rating/$times_rating;
$final_rating round($act_rating);
echo 
'Rating:' $final_rating ' From ' $times_rating ' Ratings';
}
echo 
'</p>';
echo 
'</div>';

Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
  #3 (permalink)  
Old Mar 7th, 2008, 16:13
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Help With JQuery Star Rating.

Hi Jack, I just came across this thread and I would have been able to help with the jQuery issue. I'm no help with PHP though...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
  #4 (permalink)  
Old Mar 7th, 2008, 18:17
Jack Franklin's Avatar
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,268
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: Help With JQuery Star Rating.

Hey Diego,

Thanks, but I got it working

Jack
Last Blog Entry: My Latest Project - Grilling Gurus... (Jun 11th, 2008)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spinal007 - Anyone recommend a good rating/star rating script? sing2trees PHP Forum 17 Jun 8th, 2008 21:23
jquery unitedcraig JavaScript Forum 2 May 28th, 2008 23:16
jquery, prototype, ... vs javascript thosecars82 JavaScript Forum 7 May 23rd, 2008 10:00
Half-Star Rating Plugin Feedback spinal007 JavaScript Forum 2 Mar 13th, 2008 22:43
jquery tabs prob karloff JavaScript Forum 0 Jul 4th, 2007 21:21


All times are GMT. The time now is 19:41.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43