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
srinivasan14srinivasan14 

How to disable the edit and delete button?

In my detail page i have a custom button called submit, when the submit button is clicked the order staus is changing from pending to confirmed.After that the user cannot be able to edit the order.please help me out.how to make the edit button disable after the order is confirmed.

Best Answer chosen by Admin (Salesforce Developers) 
STest123STest123

 

VisualForce Page:- 

 

<apex:page controller="Test" id="p1">

<apex:form id="f1">

 

<script>

function check()
{
document.getElementById('p1:f1:button2').style.display='none';
}

 

</script>

 

<apex:commandbutton id="button1" value="Button1" onclick="check()" />

<apex:commandbutton id="button2" value="Button2" />

 

 

</apex:form>

</apex:page>

 

Here is a simple examples when we click on button 1  then Button 2 is to be automatically hide from page. you can help from this code for solve your problem .

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

 

Thanks