function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
<apex:page controller="Sample" > <apex:form > <apex:pageBlock id="pg" > <apex:pageblockSection > <apex:pageblockSectionItem >Check it to view the button:</apex:pageblockSectionItem> <apex:pageblockSectionItem > <apex:inputCheckbox value="{!option}" > <apex:actionsupport event="onclick" action="{!change}" reRender="pg"/> </apex:inputCheckbox> </apex:pageblockSectionItem> </apex:pageblockSection> <apex:pageBlockButtons location="bottom"> <apex:commandButton value="Submit" rendered="{!bool}"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
public class Sample { public Boolean option {get;set;} public Boolean bool {get;set;} public Sample() { bool = false; } public void change() { if(option == true) { bool = true; } else { bool = false; } } }
<apex:page controller="Sample" > <apex:form > <apex:pageBlock id="pg" > <apex:pageblockSection > <apex:pageblockSectionItem >Check it to view the button:</apex:pageblockSectionItem> <apex:pageblockSectionItem > <apex:inputCheckbox value="{!option}" > <apex:actionsupport event="onclick" action="{!change}" reRender="pg"/> </apex:inputCheckbox> </apex:pageblockSectionItem> </apex:pageblockSection> <apex:pageBlockButtons location="bottom"> <apex:commandButton value="Submit" disabled ="{!NOT(bool)}"/> </apex:pageBlockButtons> </apex:pageBlock> </apex:form> </apex:page>
Please use below code:
Mark it as Best Answer, if it helps
VF Page:
Apex class: