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
SarisfdcSarisfdc 

how to Disable Command button

How to diable commandbutton by comparing two field values of two dfferent object.

Thanks
Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you
http://www.infallibletechie.com/2013/04/hide-and-show-example-using-apex-in.html
http://www.davehelgerson.com/?p=545

Please let us know if this will help you
pranab khatuapranab khatua
<apex:commandButton disabled="{!IF(Acct[0].name = 'sadasd',true,false)}" value="Send" />

If condition is met then it return true otherwise false. If it return true then button will be disable otherwise the button will be enable.
MagulanDuraipandianMagulanDuraipandian
Check this for sample - http://www.infallibletechie.com/2013/01/how-to-disable-button-in-visualforce.html
ManojjenaManojjena
Hi Sari,
You need to create boolen getter /setter in class level .You need to make check teh condition in class based on that you need to make teh varibale true or false .

As pronab has given the code you need to write like belwo .
public boolean displayButton{get;set;}
<apex:commandButton disabled="{!IF(displayButton,true,false)}" value="Button Name" />
Let us know if it helps !!
Thanks 
Manoj