0

I am trying to append a text from a People or Group (varRecipientName) into a Single Field text (.CollectedByUserClass) when a dropdown changes.

I tested it with the below code which works when setting the .val('Test')

NWF$(document).ready(function(){
var setRecipient = NWF$(".CollectedByClass");
setRecipient.change(function(){  
NWF$(".CollectedByUserClass").val('Test'); 
  });
});

However, if I want to replace the 'Test' with the value from a PoG field then it shows [object, Object].

NWF$(document).ready(function(){ 
    var setRecipient = NWF$(".CollectedByClass"); 
    var PoGName = new NF.PeoplePickerApi('#' + varRecipientName);
    setRecipient.change(function(){ 
        NWF$(".CollectedByUserClass").val(PoGName); 
    }); 
}); 

Can anybody advise on this matter?

  • by the way, is it possible to filter the ".CollectedByClass" and then act the change only when dropdown is equal to "Recipient" as a selection ? – Bucki Apr 4 at 10:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.