We have seen how to check if user belongs to a particular sharepoint group or not in Part 1. Let’s see how to show/hide/disable sharepoint fields using SPUtility.

About SPUtility

It is a javascript library used to

  • set or get field values
  • Show or hide fields
  • Make the fields as read-only

It is compatible with SharePoint 2010, SharePoint 2013, O365 and MOSS 2007.


Download the below files, copy and save it as .js

To set values when form is loaded:

function Default()

You can also use in jquery as:


To get the values:

var status = SPUtility.GetSPField('Status').GetValue();

To show, hide and disable the fields:


Insert these codes as per your requirement into previous posted code.


Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s