Skip to main content
Nintex Community Menu Bar

Nintex form

  • January 3, 2018
  • 4 replies
  • 24 views

Forum|alt.badge.img+2

How to get  a Yes/No checkbox that toggles when a People control changes its value.

4 replies

Forum|alt.badge.img+8
  • January 3, 2018

So any time the people control changes you want the yes/no field to flips its value?


Forum|alt.badge.img+2
  • Author
  • January 4, 2018

yes


Forum|alt.badge.img+7
  • January 9, 2018

Hi Anjali,

I'm not sure if you can do this with a rule on the form. I will do this with a workflow but this means update only after you saved the form.  

The workflow will kick off with a start when modified expression comparing current value for person control with previous value for person control.  If it changed, update the value to yes (if it was no) or no (if it was yes).

Let me know if you need more information.


Forum|alt.badge.img+14
  • Scholar
  • January 9, 2018

following code should toggle yes/no control value within form based on people picker change

function toggleYesNo(){
    NWF$('#' + jsvarYesNo).prop('checked',!NWF$('#' + jsvarYesNo).prop('checked'));
}


NWF.FormFiller.Events.RegisterAfterReady(function (){
   var PPObj = new NF.PeoplePickerApi('#' + jsvarPP);
   PPObj.added(toggleYesNo);
   PPObj.removed(toggleYesNo);
});

‍‍‍‍‍‍‍‍‍‍‍‍