javascript form error
<p>I have my HTML structure in the following format</p>

<pre><code>&lt;div&gt;
&lt;form class="form-inline" style="padding-top:10px" action="javascript:function()"&gt;   &lt;!-- a search bar--&gt;
  &lt;input id="id" type="text" " placeholder="Something"&gt;
   &lt;/form&gt;

&lt;button onClick="somefunction()"&gt; b&lt;/button&gt;
&lt;/div&gt;
</code></pre>

<p>the problem is I want the search bar to work when I press enter in it but unfortunately it is submitting the button element ,  I am slightly confused as the button is not a form element and I have specifically defined onClick. I am new to javascript so I am sure it is something small but I have not been able to solve it.</p>

<p>ie when I press enter , the  "somefunction()" gets active as opposed to "function()"</p>
