title: Prevent key binding on shared Javascripts
body: <p>I have a situation where I am working with a client page which has an existing Javascript that binds the enter key with form validation. I now have to insert a new javascript file which has auto suggestion functionality and can get input when user presses the enter key on selected suggestion. But this enter key messes up with the flow on the page and triggers form validation. </p>
  
  <p>Situation is like this: </p>
  
  <blockquote>
    <p>client.js // I have no control over. This triggers form validation on
    enter key. Script code cannot be changed</p>
    
    <p>myscript.js // This is auto suggestion script attached to only on input element but user can select an option by pressing enter key on selected suggestion also. I can control everything here.</p>
  </blockquote>
  
  <p>I tried having <code>event.preventDefault()</code> on myscript.js where i am handling the enter key but it does not work and still triggers the form validation.</p>
  
  <p>My question is: Can I prevent the form to be submit when dealing with my script only but work normally otherwise? My constraint is that I cannot use JQuery on the page. So the solution needs to be in native javascript.</p>
  
  <p>A sample of what I am trying to do is here: <a href="http://jsfiddle.net/o6zdo6tz/" rel="nofollow">JSFiddle</a></p>