events: {
keydown: function (editor, event) {
var code = (event.keyCode ? event.keyCode : event.which);
if (code == 13) { //Enter keycode
//$("#chatform").submit();
SendMsg(); // this is not working !
$("div.emojionearea-editor").data("emojioneArea").setText('');
$('#usermsg').val('');
return false;
}
}
}
});
//If user submits the form
function SendMsg(){
var clientmsg = $("#usermsg").val();
if(clientmsg != ''){
$.post("chat.php", {chatinput: clientmsg});
$("#usermsg").attr("value", "");
}
$("#usermsg").focus();
}`
hello after submiting enter key , the text field is cleared but it nevers call the function SendMsg()
` $("#usermsg").emojioneArea({ inline: true, hidePickerOnBlur: true, tones: false, autocomplete: false,