title: Submit form with primefaces widgets on enter
body: <p>I need to have my <code>primefaces</code> <code>p:commandLink</code> submit a <code>h:form</code> when the user presses the <code>enter</code> key. </p>
  
  <p>I tried the solutions suggested <a href="https://stackoverflow.com/questions/5485851/default-action-to-execute-when-pressing-enter-in-a-form">here</a> and in a couple of other places. I also tried the <code>primefaces</code> <code>defaultCommand</code>. No matter what I try, the browser seems to notice the button press, but the <code>action</code> is not performed. </p>
  
  <p>These are my form's widgets: </p>
  
  <pre><code>&lt;p:autoComplete id="acSimple" value="#{home.searchKeywords}" completeMethod="#{home.completeText}" style="" /&gt;
  &lt;p:commandLink id="srchbutton" action="#{home.goToSearchResults}" onclick=" $('.prgrs').show();"&gt;
      &lt;h:graphicImage id="srch" name="images/searchbutton.jpg" class="img-responsive" style="display: inline-block; margin-left:0px; margin-bottom:-0px;"  /&gt;
  &lt;/p:commandLink&gt;
  &lt;p:defaultCommand target="srchbutton" /&gt;
  </code></pre>