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
Phuc Nguyen 18Phuc Nguyen 18 

Hide disable Cancel Button on Visualforce page

Hello,
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}"/>

Thanks,
P
Vishwajeet kumarVishwajeet kumar
Hello,
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)}" 


Thanks