function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Disabling Command button

Hi their,


my code


<Apex:pageblockbuttons >
<Apex:commandButton value="Process" action="{!Submit}" rerender="SeeResult,SeeXml" onclick="if(!Submit()){return false;}" disabled="{!error}" oncomplete="processing();" />


public void Submit()


 error = true;




 I would disable the button after the first click, but I cannot figure out how to do that.  I need the button disabled as soon as the user clicks the button.


But its not working......Help pls


<Apex:pageblockbuttons id="pbb">
<Apex:commandButton value="Process" action="{!Submit}" rerender="SeeResult,SeeXml, pbb"  disabled="{!error}" oncomplete="processing();" />


I don't see anything else that's missing here. You were not rerendering the buttons I guess. Please try the code above.




Can I get through javascript or else......


You can use of <apex : facet > tag. It's quite straight-forward.


<apex:facet name="start">
<apex:outputPanel >
<apex:commandButton value="Process" disabled="true" />
<apex:facet name="stop">
<apex:outputPanel >
<apex:commandButton action="{!Submit}" value="Process"
 immediate="true"  reRender="form">