I want to pass the value of a slider to a php variable in the same document. Although I have tried ajax from online examples it doesnt work and i cant find the solution because im new to ajax and javascript. This is my javascript code:
<script type="text/javascript">
jQuery_1_1_3(document).ready(function() {
jQuery_1_1_3( ".slider-vertical" ).slider({
orientation: "vertical",
range: "min",
min: 0,
max: 2,
value: 0,
slide: function( event, ui ) {
jQuery_1_1_3( "#amount" ).val( ui.value );
jQuery_1_1_3.ajax(
{
type: "POST",
url: "question.php",
data:
{"slider":ui.value}
});
}
});
jQuery_1_1_3( "#amount" ).val( jQuery_1_1_3( ".slider-vertical" ).slider( "value" ) );
});
</script>
and i try to fetch the values with this php code:
if(isset($_POST['slider'])){
$vote=$_POST['slider'];
}
Please help me!!!!!!!!