Check if People Picker field is empty.

rss

Posted by ching29 - Aug 5 ’14 at 01:58

Hello,

 

I would like to ask how to validate people picker field if it is empty using javascript? I already have a validation for text but cannot seem to replicate it and use in peoplepicker field. Please help. Thanks.

I already read this http://formsdesigner.blogspot.com/2013/04/getting-and-setting-sharepoint-form.html but still cant make it work.

 

Best Regards,

Erica

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 16 days
    #1 by Dmitry Kozlov Aug 6 ’14 at 02:37

    Hello Erica,

    Here is the sample:

    if (fd.field('AssignedTo').value().dictionaryEntries.length == 0) {
    // AssignedTo is empty
    }
    

    You can find more samples on how to validate fields, make them mandatory or hide them conditionally in the following post:

    http://formsdesigner.blogspot.com/2014/07/how-to-conditionally-hide-disable-make.html

  • ching29
    Member
    Member for: 9 years 2 months 27 days
    #2 by ching29 Aug 7 ’14 at 03:14

    Thanks for this Dmitry.. It really helped...!

  • schuess
    schuess
    Member
    Member for: 9 years 4 months 15 days
    #3 by schuess Dec 14 ’15 at 10:51

    This worked for me when I had the field Render = Server, However, now I am using Render = Client, and the .value().dictionaryEntries.length == 0 validation check is not working.


  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 9 years 8 months 16 days
    #4 by Dmitry Kozlov Dec 15 ’15 at 03:24

    [#3]: Please, use the code below:

    if (fd.field('InternalName').value().length == 0) {
    …
    }
    
  • Goldyy6
    Member
    Member for: 1 year 8 months 26 days
    #5 by Goldyy6 Mar 27 ’23 at 06:39

    Hey! This essay writing service is a great choice for those who need help with their essays. The service provides top-notch quality and timely delivery of your work, say write my speech for me. The writers are knowledgeable and professional, and they provide helpful feedback throughout the process. The customer service team is friendly and efficient, making it easy to get the help you need. I highly recommend this service for anyone looking for quality essay writing assistance.

Displaying 1 to 5 of 5 messages