Disable / Readonly People or Group Fields

Hello,
I need to know how I can put in readonly mode or disable a People or Groups sharepoint fields.
Can someone help me to understand what I have to do?
Thanks in advance.

Hello @stefano.mazzi,

Welcome to the Plumsail Community!

You can make the field read-only in the designer:
image

Or disable the field using the code:

fd.field('Field1').disabled = true;

Learn how to disable fields dynamically using the code in this article.

Thank you @mnikitina ,
my problem was in the js and it didn't recognize the disable command.
Sorry.
Thank again.

1 Like

Hi Margarita,

I have two people picker fields in a form, within a grid that can be hidden (additional details that aren't always needed).

I have set all the other fields in the same grid to be disabled:

fd.field('TemplateReportNumber').disabled = true;

and that works fine, but when I include the same for the people picker fields, the code is ignored, and the field remains enabled.

fd.field('TemplateKeyPerson').disabled = true;

The code for the people picker fields is in the middle of the list of fields being disabled, the fields listed before and after are disabled by the code.

I can set them to be read only, but I'd rather they were disabled so all the fields look the same. Am I doing something wrong?

Regards
Nick

Hello @Nick.Jones,

Do you disable fields on form load?

If so, try wrapping the code inside the ready method. Thus you are sure the field is fully initialized and is ready to work with:

fd.field('TemplateKeyPerson').ready(function(field) {
    fd.field('TemplateKeyPerson').disabled = true;
});
1 Like

Hi Margarita,

Thanks - that worked perfectly. I'll add that to my Useful Tips doc :slight_smile:

Regards
Nick

1 Like