//html header etc.
<?php foreach($result as $row) : ?>
// info about this post
<div>
<?php
echo form_open('regcheck/comment_insert',array('name'=>'comments_form[]','id'=>'form_' . $row->post_id));
echo form_hidden('post_id[]', $row->post_id);
echo form_input('post_comment[]',NULL,'size="40" class="ta-comment"');
echo form_close();
?>
</div>
<?php endforeach; ?>
<script>
$('.ta-comment').keypress(function(event) {
var frm_id = $(this).parents('form').attr('id');
if (event.which == 13 ) {
event.preventDefault();
$('#' + frm_id).submit();
}
});
</script>
//html footer etc.