mohammad qasim

mohammad qasim

  • NA
  • 408
  • 0

How to show all on page edit when login as admin

Jul 30 2020 7:03 AM
Hi,
have pasted some script on "page edit" using page editor web part which hide fields succssfully
My Script:
<script type="text/javascript">
SP.SOD.executeOrDelayUntilScriptLoaded(CustomJS, 'sp.js');
function CustomJS() {
$("input[Title='Filename']").prop("disabled", true);
$('nobr:contains("Name")').closest('tr').hide();
$('nobr:contains("Title")').closest('tr').hide();
$('nobr:contains("User")').closest('tr').hide();
$('nobr:contains("Flag")').closest('tr').hide();
$('nobr:contains("status")').closest('tr').hide();
$('nobr:contains("docType")').closest('tr').hide();
$('nobr:contains("ParentdeptID")').closest('tr').hide();
$('nobr:contains("ModifiesStatusDate")').closest('tr').hide();
$('nobr:contains("RespondBy")').closest('tr').hide();
$('nobr:contains("docreason")').closest('tr').hide();
$('nobr:contains("SopIDLevel4")').closest('tr').hide();
}
</script>

Problem: Wheater i login as a admin or contributor all fields are hidden.
 
Solution Required: if i login as a Admin or Site Collection Administrator all fields should be available not hide.
 
How can i do this
 

Answers (2)