﻿// prevent a Form submir with ENTER
document.onkeypress = function(objEvent)
{
    if (!objEvent)
        var objEvent = window.event; // IE

    // check if the target is a textarea element
    var elem = (objEvent.target) ? objEvent.target : objEvent.srcElement;
    if (elem.type == "textarea")
    {
        // a textarea has the focus, allow Enter
        return true;
    }

    if ( objEvent.keyCode == 13 ) // enter key
    {
        return false; // this will prevent bubbling ( sending it to children ) the event!
    }
}