How can you make the keypress action work? Got a chat, with which i want to send - what else - messages. In the Form-tag (its jsp based) i got this:
" name="chat" target="content" onkeypress="Javascript: if (event.keyCode==13) SendMessage();" OnSubmit='SendMessage();return false;'>
the function in the script is the following:
function SendMessage()
{
if (event.keyCode===13) {
alert('ENTER PRESSED'); // to make sure the function is called
document.chat.submit();
document.chat.msg.value = "";
document.chat.reset();
document.chat.msg.focus();
}
}
This is working fine on Chrome but not on Firefox, but it should work on every Browser. In addition, this script causes firefox to not clear the textfield (i think, because the function is not called properly). Any suggestions or help on this? i'm pretty lost..