I have custom button on standard detail page...I want to disable that button/gray out if my status picklist value is "Approved". Java script on button click
var newRecords = [];
var o = new sforce.SObject("Opportunity");
o.id ="{!Opportunity.Id}";
if ( o.Sub_Stage__c == 'Approved')
{
// disbale button
}
Can some tell me how to do this..

