Make people picker field read only after saving

rss

Posted by TWendt - Sep 23 ’16 at 08:52

Hi all,

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

Best regards

Tom

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 9 months 26 days
    #1 by Dmitry Kozlov Sep 26 ’16 at 05:16

    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
    Member
    Member for: 4 years 10 months 8 days
    #2 by TWendt Sep 26 ’16 at 05:22

    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

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 5 years 9 months 26 days
    #3 by Dmitry Kozlov Sep 26 ’16 at 06:19

    [#2]: Then disable the field with JavaScript if it has a value:

    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
    Member
    Member for: 4 years 10 months 8 days
    #4 by TWendt Sep 27 ’16 at 04:30

    Hi Dimitry,

    thanks for your assistance, it works great.

    Best regards

    Tom

Displaying 1 to 4 of 4 messages