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
ADGADG 

Need to remove the 'Submit for Approval' button from Approval History Section

I have put a Custom Button on a page which triggers an Approval Process, so I want to remove the Submit for Approval button from the Approval History section.

I found several posts suggesting using of a jquery to remove the button, but those did not work.
https://developer.salesforce.com/forums/?id=906F00000009F8IIAU
https://developer.salesforce.com/forums/?id=906F00000008pZMIAY

I have put the following jQuery code in a VF Page and added it to the Sidebar of the Home Page Component, but the Submit for Approval button did not get removed:
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script>
      $j = jQuery.noConflict();
      $j(document).ready(function(){   
        $j("input[name='piSubmit']").hide();
      });
    </script>

If someone knows what I am missing, please let me know.
Also any other alternative idea to achieve this is very much welcome.
Best Answer chosen by ADG
Bhavin Mehta 20Bhavin Mehta 20
Please check if you can hide using below CSS code.
<style type="text/css">
 
        input.btn[name="piSubmit"] {
           display :none;
        }
        
        
        }
        
    </style>

Also visit this URL once.
https://developer.salesforce.com/forums/?id=906F0000000BNxxIAG

All Answers

Bhavin Mehta 20Bhavin Mehta 20
Please check if you can hide using below CSS code.
<style type="text/css">
 
        input.btn[name="piSubmit"] {
           display :none;
        }
        
        
        }
        
    </style>

Also visit this URL once.
https://developer.salesforce.com/forums/?id=906F0000000BNxxIAG
This was selected as the best answer
ADGADG
Hi Bhavin, thanks for your feed..

The CSS code you mentioned would work fine the button was on the the same VF page; but in my case this would not work because the button is not in the VF page, rather it is in the main page.

However, the link you provided was very helpful, and I could use some codes mentioned in there which solved my problem.