+ Start a Discussion
Phuc Nguyen 18Phuc Nguyen 18 

Hide disable Cancel Button on Visualforce page

Is there a way to hide/remove the Cancel button ona  visualforce page?  When the button is clicked I can see that the Save button is greyed out but the cancel is not.  The page does disapear but I do not want the user to accidently click the cancel button.

VF Page
<apex:page standardController="Project__c" extensions="CreateNewProRecord" action="{!newRecord}"/>

Vishwajeet kumarVishwajeet kumar
You can try to use a Controller variable to hide "Cancel" button, set it to true when you need to hide the button. On button use this variable on Redered attribure.

Something like this : 
Controller Variable -  boolean m_HideCancelBtn{get; set;}

on page, in button component: rendered = "{!NOT(m_HideCancelBtn)}"