Page 1 of 1

on change for people picker

Posted: 02 Nov 2017
by RMIC
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!

Re: on change for people picker

Posted: 02 Nov 2017
by Nikita Kurguzov
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)
});

Re: on change for people picker

Posted: 02 Nov 2017
by RMIC
It works! Perfect!