In the reply submissions only 1st comment reply works
I am working a big project. I am getting stuck at making comment reply
system. It works fine with Ajax but when I post second or another comment
reply then text-area shows empty. Why is only the 1st reply submitted
successfully? Here is my code:
$(document).ready(function(){
$(".post_reply").click(function(rp) {
rp.preventDefault();
var box_id = $(".bid").val();
var ownerc = $(".owner").val();
var replyc = $(".reply").val();
var commentc_id = $(".comment_id").val();
var dataString = 'bid='+ box_id + '&owner=' + ownerc +
'&comment_id=' + commentc_id + '&reply=' + replyc;
alert(replyc);
if(ownerc=='' || box_id=='')
{
alert('Please Give Valide Details');
}
else
{
$.ajax({
type: "POST",
url: "sub_comment.php",
data: dataString,
cache: false,
success: function(replys){
$('#replys'+commentc_id).append(replys);
$(".reply").val('');
}
});
}
return false;
});
});
No comments:
Post a Comment