title: Laravel Form run JS function onsubmit
body: <p>I have a function that I want called on submission of my Laravel Form for Ajax purposes.  How can I go about this where the page does not submit and reload?</p>
  
  <p>This works: (but the Enter btn does not execute)</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php echo Form::open(); ?&gt;
      &lt;?php echo Form::button('Search', array('id'=&gt;'searchbtn', 'class'=&gt;'button radius right', 'onclick'=&gt;'myFunction(this.form)')); ?&gt;
  &lt;?php echo Form::close(); ?&gt;
  </code></pre>
  
  <p>This does not:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php echo Form::open(array('onsubmit' =&gt; 'myFunction(this)')); ?&gt;
      &lt;?php echo Form::submit('Search', null, array('id'=&gt;'searchbtn', 'class'=&gt;'button radius right')); ?&gt;
  &lt;?php echo Form::close(); ?&gt;
  </code></pre>