How do I prevent bootstrap modal screen from appearing when I press enter

How do I prevent bootstrap modal screen from appearing when I press enter

Hello,

Im using bootstrap to create a modal screen. 

When I press "enter" to do a submit, the modal screen appears. But then disappears.

How can I prevent the modal screen from appearing when pressing "enter"

  1.  document.onkeypress = enter;             
  2.  function enter(e) {                      
  3.   if(e.which == 13){                      
  4.    sendform();                            
  5.   }                                       
  6.  }                                        
  7.                                           
  8.  function sendform(){                     
  9.   document.S1.MODE.value  = "DSP";        
  10.   document.S1.submit();                   
  11.   return true;                            
  12.  }                                        

Thank You