How to prevent ENTER key to change line in web form
<p>I want to submit the form by press the ENTER key.
But it also change the line in content.
How to prevent this?</p>

<p>This is my code, but when hit ENTER, the ... run and Cursor moved to the next line:</p>

<pre><code>function postmessage(e) {
    if(e) {
        e.preventDefault = null || e.preventDefault;
        if(e.preventDefault) {
            e.preventDefault();
        } else {
            e.returnValue = false;
        }
    }
    ....
    return false;
}

function submitmessage(e) {
    if(e.keyCode == 13) {
        postmessage(e);
    }
    return false;
}

function bindEvent(el, eventName, eventHandler) {
  if (el.addEventListener){
    el.addEventListener(eventName, eventHandler, false); 
  } else if (el.attachEvent){
    el.attachEvent('on'+eventName, eventHandler);
  }
}

bindEvent(text, 'keydown', submitmessage);
</code></pre>
