I'm having the following problem when asking for jquery to open the form it ends up opening all at once to send a reply in the comment, but I need it to open just what I clicked as I do this. Follow the codes.
javascript
$(document).ready(function(){
$('.resposta').click(function(){
var id = $(this).children('input').val();
var resposta = $('.restposta').id;
$('.resposta').fadeOut("fast");
$('.resp').fadeIn("fast");
});
return false;
});
Php that takes the data from the bank
<?php
/*
**********************************************
**********************************************
***********Função para exibição dos***********
****************comentarios*******************
**********************************************/
$comentar = new Read;
$comentar ->ExeRead('coment', 'WHERE video = :video ORDER BY id DESC LIMIT 4', "video={$sei[1]}");
foreach ($comentar->getResult() as $big):
extract($big);
$image = new Read;
$image ->ExeRead('users', 'WHERE id = :id', "id={$big['user']}");
foreach ($image->getResult() as $imx)
extract ($imx);
/*
**********************************************
**********************************************
*********Fim da função de exibição************
***************de comentarios*****************
**********************************************/
echo "<input type='text' hidden='hidden' value='{$link}' id='link'>";
?><div class='comentar fl-left'><div class='coment com' >
<?php
if($foto == "" || $foto == "uploads/"):
echo "<a href='user?id={$id}'><img class='fl-left' src='".REQUIRE_PATH."/css/boot/icons/thumb.png'></a>";
else:
echo "<a href='user?id={$id}'><img class='fl-left' src='{$imx['foto']}'></a>";
endif;
echo "<p><small class='fontze1'>Comentado por:</small> {$nome} <small>Em: </small> {$date} <small>As: </small> {$hora}</p>
<p>".nl2br($comentario)."</p><div class='btn btn-green fl-right resposta'>Responder <input type='hidden' value='$big[id]' name='idcoment'></div><div class=' resp' style='display:none'><form method='post'>
<textarea></textarea> <input class='btn btn-green' type='submit' value='responder' name='responder'>
</form></div></div>";
endforeach;
endforeach;
endforeach;
Edit: I also noticed that clicking on show more that appear on the page does not work the answer function does not open anything and was to be opened when clicked it does not perform any action