Disable VF Command Button After First Click

Disable VF Command Button After First Click


Code:
If you are using command button
<apex:commandButton action="{!saveRec}" value="Save"  />

Replace It with the below Code:
<apex:actionStatus id="disablebtn">
          <apex:facet name="stop">     
                 <apex:commandButton action="{!saveRec}" status="disablebtn"                     value="Save" disabled="false" rerender="mySaveStatus"/>     
          </apex:facet>     
          <apex:facet name="start">
                  <apex:commandButton action="{!saveRec}" status="disablebtn"                          value="Processing..." disabled="true"/> 
          </apex:facet>
 </apex:actionStatus>
Result:




P.S: Comment Below for any Clarification or help!!

Happy working!! :) :) 

Comments

Popular posts from this blog

Embed Special Characters in VF Page

Error: Compile Error: Illegal conversion from String to System.PageReference

Some Common Errors in the Visual flow