Hide ribbon based on item approval status

Sviatoslav Bulash -

Place this script on list DispForm.aspx

Ribbon will be hidden if item has status Approved or Rejected or Pending.

 

<script>
$(function () {
$("[id='Ribbon.ListForm.Display-title']").hide();
$('h3:contains("Approval Status"),h3:contains("Approval Request")').closest('tr').hide()
var $status = $('h3:contains("Approval Status")').closest('td').next('td');
if ($status.has(":contains('Approved'),:contains('Rejected'),:contains('Pending')").length) {
$("#s4-ribbonrow").hide(); }

});
</script>

Have more questions? Submit a request

Comments

Powered by Zendesk