How can I put a ajax delete button for delete the comment by the posted user?
_form
echo '<div><h3><b><u>Comments</u></b></h3></div>';
$commentList = Comments::model()->findAllByAttributes(array('offereventid'=>$id));
foreach($commentList as $Listdata2)
{
$usercomment = $Listdata2['comment'];
$usercommentid = $Listdata2['id'];
$usercomtname = $Listdata2['name'];
$usercommentmail = $Listdata2['email'];
echo '<div><span class="name1">'.$usercomtname.':</span> '.'<span class ="email1">'.'['.$usercommentmail.']'.'</span>'.'</div>';
echo '<div class = "cmnts" >'.'"'.$usercomment.'"'.'['.$usercommentid.']'.'</div>';
// echo CHtml::ajaxSubmitButton('Delete ', array('delete', 'id'=>$usercommentid));
echo '<hr>';
}
please help me with it. I tried lot of methods but when i tried any user can delete the comment of any user.