<form action="/" method="post" id="{{ message["uuid"] }}" name="send_post">
<input type="hidden" name="user" value="{{ message["user"] }}">
<input type="hidden" name="uuid" value="{{ message["uuid"] }}">
<input name="comment" type="text" placeholder="{{ _('type comment here') }}">
<button type="submit">{{ _('send') }}</button>
</form>
var elems = document.getElementsByName('send_post');
for (i = 0; i < elems.length; i++) {
var form = elems[i];
form.onsubmit = function(e){
socket.send_message(form);
return false;
};
form.onkeypress = function(e){
if (e.keyCode == 13) {
socket.send_message(form);
return false;
} }; };