I have separate reply form with each post with it's own php $id
in same page. So I want to submit each reply with keyboard Enter key. I collect this javascript code below from here, but I cannot understand how apply it for each reply.
B.N: Collected code not working also.
my form:
<form action="" method="post" class="repfrm'.$id.'" id="prepfrm">
<textarea name="replycom" id="replycom'.$id.'" class="replycom"></textarea>
<button type="submit" name="submit" id="'.$id.'" class="replyfrm">Post Reply</button>
</form>
Collected Script From stockoverflow:
$(".replycom").keyup(function(event){
if(event.keyCode == 13){
$(".replyfrm").click();
}
});