Welcome to WebmasterWorld Guest from 23.22.182.29

Forum Moderators: open

Message Too Old, No Replies

Get in PHP rating value from a dynamic bar

User drag bar and i need value in PHP

     
10:12 pm on Jul 22, 2011 (gmt 0)

Full Member

5+ Year Member

joined:Dec 27, 2006
posts:311
votes: 0


For each article I have a rating script and user drag the bar to select a value from 1 to 10. The current value selected by user is displayed in browser eg. 5 stars.

I do not know how to get that value in the input form, to upload it in mysql database.

The value is named value in code
 + value + ' stars'


Here is the code:
 
<head>
..
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="http://www.mysite.com/js/rating.js"></script>
</head>
..


<div id="rating-22"></div>
<div id="result-22"></div>
<div id="currentval-22"></div>


<script type="text/javascript">
$('#rating-22').slidy({
maxval: 10, interval: 1, defaultValue: 4,
finishedCallback: function (value) {
$('#result-22').html
('You selected: ' + value)
;
},
moveCallback: function (value) {
$('#currentval-22').html('<strong>' + value + ' stars' + '</strong>')
}
});
</script>


<form method="post" action="http://www.mysite.com/<?php echo $article_id;?>.html">

<input type="hidden" name="slidy_rating_value" value="HERE_I_NEED_RATING_VALUE">

</form>

..


Any help is appreciated. Thanks
12:15 am on July 23, 2011 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 3, 2005
posts:1585
votes: 0


add line


$('#currentval-22').html('<strong>' + value + ' stars' + '</strong>');
$('#idSlidy').val(value);

and add id to input element

<input id=idSlidy type="hidden" name="slidy_rating_value" value="HERE_I_NEED_RATING_VALUE">
12:36 pm on July 23, 2011 (gmt 0)

Full Member

5+ Year Member

joined:Dec 27, 2006
posts:311
votes: 0


Is working, thanks!

It does not refreshing in source code, but when i get data from input with POST the correct value is there.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members