Clear all the users from People Control on Nintex Form


Badge +2

I have People Control added to my Nintex Form. I want all the users to be cleared/removed from the field.

The control settings are as below -

Whenever I open the form the users that were selected in the last instance are availabel. I want to remove these users from the control on the form using JavaScript.

I am able to retreive the value of these users using the below JavaScript.

var companyUsers = NWF$('#' + fldCompanyUsers).val();

alert(companyUsers);

However, I am just not able to clear the control of all the usesr.

Any help is appreciated.

Thanks.


6 replies

Userlevel 5
Badge +14

see  

Badge +2

I have already checked that article. It talks about adding the users. I could not figure out, hoe to remove the users, from it.

I tried -

NWF$('#' + fldCompanyUsers).clear();

But, this does not do the required.

Userlevel 5
Badge +14

read through it carefully what's the proper usage. and there is an example how to remove an user as well.

to clear all the users following should work

var varPP = new NF.PeoplePickerApi('#' + fldCompanyUsers);
varPP.clear();
Badge +2

That did the Job.

I was trying to mix both the statements. But puttting them seperate as given by you, has done the trick.

Thanks, I appreciate your efforts.

Userlevel 5
Badge +14

converted discussion to question.

Userlevel 5
Badge +14

great!

if you have a working solution please select and mark correct answer.

Reply