title: Can't disable p:commandButton on form for file upload - PrimeFaces
body: <p>I'm trying to make a  a "one-click button" to make impossible to send twice the request of an action method in a file upload form. Here's the code:</p>
  
  <pre><code>&lt;h:form id="importForm" enctype="multipart/form-data"&gt;
     &lt;p:messages id="messages" showDetail="true" autoUpdate="true"/&gt;
  
     &lt;h:panelGrid&gt;            
       &lt;p:fileUpload value="#{importController.uploadFile}" mode="simple" /&gt;
  
       &lt;p:commandButton id="importButton" styleClass="commandButton" value="Send" action="#{importController.getFile}" ajax="false"/&gt;   
     &lt;/h:panelGrid&gt;
  &lt;/h:form&gt;
  </code></pre>
  
  <p>If I set the value of <code>onclick="importButton.disable()"</code>,  the button is disabled but the action method is never called. If I put as callback something like <code>onclick="alert('hello!')"</code> the request is sent. Does  PrimeFaces generates some sort of JS code that controle if submit button is disabled?</p>
  
  <p>Any help? Thanks!</p>
  
  <p>PrimeFaces 3.3.1</p>
  
  <p>Liferay 6.0.1 with embedded Tomcat 7.0.23 in a Java6</p>
  
  <p>PrimeFaces Liferay Bridge 3.1.1-ga2</p>