You need to sign in to do that
Don't have an account?
Chaitra GV
How to disable a button on visualforce page
I wanted to disable edit button once the status of case is closed. Is it possible to disable a button in visualforce? How can it be achieved?
Use the below line of code in your vf page:
<apex:commandButton value="Submit" disabled="{!hidebutton}"/>
In your Apex class make a Boolean variable named "hide" that will initially be false inside the constructor.
As per your condition, you can make your button disabled or undisabled by simply turning Boolean variable hide value
to true or false.
In Apex:
public Boolean hidebutton{get;set;}
Also, go through the links below for more information:
http://www.infallibletechie.com/2013/01/how-to-disable-button-in-visualforce.html
http://www.infallibletechie.com/2013/12/how-to-disable-and-enable-button-in.html
I hope this explanation is helpful. Mark it as best answer if it helps so that others also get help from this.
Thanks.
Ajay Dubedi
All Answers
Greetings to you!
Please refer to the below links which might help you further with the above requirement.
http://blogatsalesforce.blogspot.com/2015/04/enable-disable-buttons-on-standard.html
https://developer.salesforce.com/forums/?id=906F0000000Ag39IAC
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
Use the below line of code in your vf page:
<apex:commandButton value="Submit" disabled="{!hidebutton}"/>
In your Apex class make a Boolean variable named "hide" that will initially be false inside the constructor.
As per your condition, you can make your button disabled or undisabled by simply turning Boolean variable hide value
to true or false.
In Apex:
public Boolean hidebutton{get;set;}
Also, go through the links below for more information:
http://www.infallibletechie.com/2013/01/how-to-disable-button-in-visualforce.html
http://www.infallibletechie.com/2013/12/how-to-disable-and-enable-button-in.html
I hope this explanation is helpful. Mark it as best answer if it helps so that others also get help from this.
Thanks.
Ajay Dubedi