Reputation: 19
I am using this jQuery star rating plugin
But where do you add the link that points to the PHP file where the data is inserted in the database?
Upvotes: 0
Views: 2739
Reputation: 19
This is what needs to be done:
$('input.wow').rating({
callback: function(value){
$.ajax({
type: 'GET',
url: "http://www3.inrees.com/rating_films_ajax.php?action=voter",
data:"films_id=<?php echo $id; ?>&rating="+value,
success: function(){
alert(value);
}
})
}
})
Question answered and my middle finger to the conceiver of the plugin
Upvotes: 1
Reputation: 11095
Check that page source code: it seems there is no file do specify: it's a simple HTML form:
<form name="api-select">
<span class="star-rating-control">
<div class="rating-cancel"><a title="Cancel Rating"></a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live star-rating-on"><a title="A">A</a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live star-rating-on"><a title="B">B</a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live star-rating-on"><a title="C">C</a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live"><a title="D">D</a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live"><a title="E">E</a></div>
</span>
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="A" type="radio">
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="B" type="radio">
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="C" type="radio">
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="D" type="radio">
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="E" type="radio">
<input value="Submit »" onclick="$(this).next().html( $(this.form).serialize() || '(nothing submitted)' );" type="button">
</form>
Therefore I think you should just set your action
and method
attributes on the form element.
Upvotes: 0