homepage Welcome to WebmasterWorld Guest from 54.166.122.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Get in PHP rating value from a dynamic bar
User drag bar and i need value in PHP
rowtc2

5+ Year Member



 
Msg#: 4342922 posted 10:12 pm on Jul 22, 2011 (gmt 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

 

daveVk

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 4342922 posted 12:15 am on Jul 23, 2011 (gmt 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">
rowtc2

5+ Year Member



 
Msg#: 4342922 posted 12:36 pm on Jul 23, 2011 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved