How to identify an invalid people picker value

Forums Classic DFFS How to identify an invalid people picker value

Viewing 2 reply threads
  • Author
    • #34597
      Ivan Wilson

      We have a form where we prefill a lot of the fields in code. We only display a subset of the fields in the form, depending on the scenario.

      We’ve run into an issue where we populate a hidden people picker field with an old value that is no longer valid. We want to be able to identify that the field is invalid and fix the issue without requiring the user to take any action. For this case, we can just clear the field.

      What is the best way to do this?

    • #34600
      Alexander Bautz

      You can use something like this after you have filled in all the fields:

          jQuery(".sp-peoplepicker-errorMsg").each(function(i, elm){
              var fin = jQuery(elm).parents("tr:first").attr("fieldinternalname");
              console.log("There is a validation error in this field: " + fin);
              setFieldValue(fin, "");


    • #34602
      Ivan Wilson

      Perfect, thanks Alexander

Viewing 2 reply threads
  • You must be logged in to reply to this topic.