title: calling a Javascript function that makes a click on a (hidden) button or link
body: <p>I call a javascript function that makes a click on a hidden commandButton but the click run when the page loads, not when I call the function.
  this is the html code : </p>
  
  <pre><code>&lt;p:inputText id="aa" value="#{bonBonneManagedBean.sel}" onkeyup="fnc()" /&gt;
  &lt;h:commandButton id="hh" onclick="#{bonBonneManagedBean.kk()}" style="display:none"/&gt;
  </code></pre>
  
  <p>and the javaScript function : </p>
  
  <pre><code>function fnc()
  {
      length = document.getElementById('form:aa').value.length;
      if(length == 10)
      {
          $("#hh").click();
          document.getElementById('form:aa').value = "";
      }
  }
  </code></pre>