// disable Internet Explorer form submission via the enter key 
if (navigator.appName.indexOf("Microsoft")!=-1){
  document.onkeypress=function(){
    var tagAttr=event.srcElement.getAttribute("type");
    if (event.keyCode==13 && tagAttr!="textarea"){
      return false;
      }
    }
  }

// disable Netscape 6+ form submission via the enter key 
var bAllowFormSubmission=false;
if (window.Event && document.getElementById){
  window.captureEvents(Event.SUBMIT);
  window.onsubmit = NetscapeEventHandler_Submit;

  window.captureEvents(Event.CLICK);
  window.onclick = NetscapeEventHandler_Click;
  }
  
function NetscapeEventHandler_Submit(e) {
  if(!bAllowFormSubmission) return false;
  }

function NetscapeEventHandler_Click(e) {
  if(e.target.getAttribute("type")){
    var sTarget=e.target.getAttribute("type");
    if(sTarget=="image" || sTarget=="submit"){
      // mouse click occured on a tag with an attribute 'type' set to 'image' or 'submit'
      // this can only be an input tag
      // if the click on the button was simulated by the browser, the x and y coordinates of the click will be (0,0); do not allow form submission
      // after text has been entered in a textbox, if the user hits the enter key, netscape simulates a mouse click on a submit button
      if (e.screenX>0 && e.screenY>0) bAllowFormSubmission=true;
      }
    }
  }

