on change for people picker

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
RMIC
Posts: 96
Joined: Sun May 10, 2015

02 Nov 2017

Hello,

I would like to have an onChange for a person field in edit form. (Office 365)

fd.field ('People_Picker_Column'). change (function () {
alert("has been changed");
fd.field('Change_Owner_Teammember_Approver').value('text');
});

The onChange function works too. But, when I call the edit-form, sharepoint first writes the person's internal name and converts it to the display form. This triggers an onChange, which I do not want.

How can I adjust that?

Thanks!

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

02 Nov 2017

Hello, RMIC!
Yes, it seems to trigger change when the Edit form loads and even checking if the field is ready or not does not seem to help.
But it works with a simple timeout like this:

Code: Select all

fd.field('User').control('ready', function() {
    setTimeout(function(){ 
        fd.field('User').change(function() {
            alert("Has changed");
         }); 
    }, 1000)
});
Cheers

RMIC
Posts: 96
Joined: Sun May 10, 2015

02 Nov 2017

It works! Perfect!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests