cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
jr204
Nintex Newbie

Javascript to clear unresolved text from a People Picker?

Jump to solution

Hello all,

I am working on a form where a Person control is made available to the user conditionally based on the state of another control on the form (an internal vs. external user dropdown).

On most conditional fields, I've implemented onChange JS functions which clear the controls to prevent submission of data in fields which are no longer needed.  (If data is entered into a field and the condition is changed where that field is no longer needed, the data in the hidden field will be cleared and will not be submitted.)

Now I am presented with the challenge of clearing unresolved text from a people picker.  Any unresolved text in the picker, even if the control is hidden or disabled, seems to prevent the form from submitting.

I'm just wondering if anyone has achieved this before and how to go about doing so.

Thanks!

0 Kudos
Reply
8 Replies
Automation Master
Automation Master

Re: Javascript to clear unresolved text from a People Picker?

Jump to solution

Have you tried to use the clear() method of the people picker javascript API (People Picker Extensions - Nintex Forms ) ?

Reply
jr204
Nintex Newbie

Re: Javascript to clear unresolved text from a People Picker?

Jump to solution

Thanks for your response.  I am currently using the clear() method.  The issue I'm encountering with the clear method is that it only seems to clear the resolved entries in the people picker.

If I type some text and DON'T resolve the entry, and another control on the form (a checkbox for example) hides the people picker, the form will not submit and I get a message indicating there are unresolved fields on the form.

Any other suggestions?

0 Kudos
Reply
Automation Master
Automation Master

Re: Javascript to clear unresolved text from a People Picker?

Jump to solution

You can try the following :

NWF$("#" + yourPeoplePickerControlID + " textarea").val('');

Hope it works

Reply
jr204
Nintex Newbie

Re: Javascript to clear unresolved text from a People Picker?

Jump to solution

Just tried that and unfortunately I am still encountering issues.  The unresolved text remains in the picker control after the function should have fired.  The resolved entries are still being properly removed by the clear() function.

I appreciate any further assistance.  Thanks!

0 Kudos
Reply
Automation Master
Automation Master

Re: Javascript to clear unresolved text from a People Picker?

Jump to solution

Sorry, I didn't test.

This should work :

NWF$("#" + yourPeoplePickerControlID).parent().find("textarea").val('');

Reply
jr204
Nintex Newbie

Re: Javascript to clear unresolved text from a People Picker?

Jump to solution

That did it.  Thank you so much!

0 Kudos
Reply
Automation Master
Automation Master

Re: Javascript to clear unresolved text from a People Picker?

Jump to solution

Great !

I'm glad that I could help !

0 Kudos
Reply
prashanth_hamse
Nintex Newbie

Re: Javascript to clear unresolved text from a People Picker?

Jump to solution

I am using External Data column which has picker control. how to get on change event and retrieve selected value using java script.

This control is using as textpicker

var ExC = NWF$("#" + varExtDataCol).parent().find("textarea").val();
alert(ExC); --> I get lot of text which has displaytext='' and isResolved='true'

how can i get if isResolved='True' and displaytext values

0 Kudos
Reply