Reputation: 37
I have problem in sending one variable (i) to my php. My variable i is 6 everytime, how can i fix it?
$(document).ready(function(){
for (i=1; i<=5; i++){
$('#rate'+ i +'_').click(function(){
sendValue($(this).val(),i);
});
}
});
function sendValue(str,str2){
$.post("/php/test.php",{ sendValue: str, sendValue2 : str2 },
function(data){
$('#display').html(data.returnValue);
}, "json");
}
Upvotes: 0
Views: 248