Make people picker field read only after saving

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
TWendt
Posts: 109
Joined: Mon Sep 08, 2014

23 Sep 2016

Hi all,

is it possible to make the people picker field read only after saving?

Best regards

Tom

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

26 Sep 2016

Hi,

Do you mean that you need to make it read-only in the edit form? If so, just set ReadOnly property in True in Forms Designer.

TWendt
Posts: 109
Joined: Mon Sep 08, 2014

26 Sep 2016

Hi,

no. The decision makers opens the form in edit mode. Then they select the name in the people picker field for approval and save the form. When the form is open again, the people picker field should be read only.

Best wishes

Tom

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

26 Sep 2016

Then disable the field with JavaScript if it has a value:

Code: Select all

fd.field('User').control('ready', function() {
	if (fd.field('User').value().length > 0) {
	    fd.field('User').readonly(true);
	}
});
Where 'User' is the internal name of your people picker field.

TWendt
Posts: 109
Joined: Mon Sep 08, 2014

27 Sep 2016

Hi Dimitry,

thanks for your assistance, it works great.

Best regards

Tom

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests