Forum

HomeHomeCoreCoreGeneralGeneralTry to use JQuery Star rating wituout successTry to use JQuery Star rating wituout success
Previous
 
Next
New Post
11/9/2009 11:57 PM
 
Hi,
to test it I've simply add to a Template No Query the following lines, checking JQuery and the JQuery Noconflict (on DNN 4.9 and OWS 2.1.17)..but it doesn't work :


script type="text/javascript" src="/js/ui.starts/ui.stars.js">
link rel="stylesheet" type="text/css" href="/js/ui.starts/ui.stars.css"/>
script type="text/javascript">
$(function(){
$("#ratings").children().not("select").hide();

// Create target element for onHover titles
$caption = $("");

$("#ratings").stars({
inputType: "select",
captionEl: $caption, // point to our newly created element
callback: function(ui, type, value)
{
$.post("demo2.php", {rate: value}, function(data)
{
$("#ajax_response").html(data);
});
}

});

// Make it available in DOM tree
$caption.appendTo("#ratings");
});
/script>


form id="ratings" action="demo2.php" method="post">

select name="rate">
option value="1">Very poor
option value="2">Not that bad
option value="3">Average
option value="4">Good
option value="5">Perfect
/select>

input type="submit" value="Rate it!" />

/form>

p id="ajax_response">


/div>

I've remove all the <

The example is taken at this website: http://orkans-tmp.22web.net/star_rating/

Thanks
Enzo
New Post
11/10/2009 5:17 AM
 

Convert your $ symbols to $jq

New Post
11/10/2009 6:07 AM
 
Hi,
I've changed in $jq the following lines (all the $ except $caption) but it doesn't work.....

$jq(function(){
$jq("#ratings").children().not("select").hide();

// Create target element for onHover titles
$caption = $jq("");

$jq("#ratings").stars({
inputType: "select",
captionEl: $caption, // point to our newly created element
callback: function(ui, type, value)
{
$jq.post("demo2.php", {rate: value}, function(data)
{
$jq("#ajax_response").html(data);
});
}

});

// Make it available in DOM tree
$caption.appendTo("#ratings");
});
New Post
11/10/2009 6:23 AM
Accepted Answer 

Not sure, you might try using a different one.

Here is one I have used with success in the past. http://www.fyneworks.com/jquery/star-rating/#tab-Testing

It works simply with the following code.

<script src="/js/jquery/jquery.rating.js" type="text/javascript" language="javascript"></script>
<link href="/js/jquery/jquery.rating.css" type="text/css" rel="stylesheet"/>
<div class="review_rating" style="clear:both;">
<input class="star" type="radio" name="rating" value="1.0" {IIF,"[Rating]=1","checked",""}/>
<input class="star" type="radio" name="rating" value="2.0" {IIF,"[Rating]=2","checked",""}/>
<input class="star" type="radio" name="rating" value="3.0" {IIF,"[Rating]=3","checked",""}/>
<input class="star" type="radio" name="rating" value="4.0" {IIF,"[Rating]=4","checked",""}/>
<input class="star" type="radio" name="rating" value="5.0" {IIF,"[Rating]=5","checked",""}/>
</div>

Previous
 
Next
HomeHomeCoreCoreGeneralGeneralTry to use JQuery Star rating wituout successTry to use JQuery Star rating wituout success


 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share