Requirement: We've a "Requests" link in our Help Desk site. The "Status" field in help desk requests list should be hidden when users create new entry in the list. Same time, Status field must be visible to people in "Help desk operators" group.
So, the requirement is to hide SharePoint List Form field based on user permissions!
Solution: Use SPServices to check whether the current user is member of a particular group. If not, hide the field using jQuery (or you can make the field Read-only too: How to Make SharePoint List Column Read Only ). Here is the detailed steps:
- Place the below script in a text file, upload to any SharePoint library of the site.
- Edit the NewForm.aspx, Add a content editor web part just below form fields, point the script file in CEWP and make the content editor web part hidden.
Instead of content editor web part, You can also edit the NewForm.aspx or EditForm.aspx file and place the code under "PlaceHolderAdditionalPageHead" to hide fields in SharePoint list forms.
Here is the NewForm.aspx view for "Help Desk Operators" - Note that the "Status" field is visible.
You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.