In my HTML css:
.edit_field {
height: 50px;
width: 495px;
line-height: 3.6;
}
html:
Try this:
$('#message').keyup(function(e){
if(e.keyCode == 13){
//your code probably want e.preventDefault() as well
}
});
I've found keypress implementation to not be so cross-browser friendly. Just a thought.
Edit: I now remember why this doesn't work in IE8. The enter key (keycode 13) is considered a "Special Key" (as well as others like arrow keys on the keyboard) IE does NOT fire a keypress event for "Special Keys" which is why I had to use keyup.
You can find more info here: http://www.quirksmode.org/dom/events/keys.html
Look under "Special Keys"