Check if People Picker field is empty.

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
ching29
Posts: 15
Joined: Thu Mar 13, 2014

05 Aug 2014

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://spform.com/forms-designer- ... eld-values but still cant make it work.



Best Regards,

Erica

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

06 Aug 2014

Hello Erica,

Here is the sample:

Code: Select all

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://spform.com/office-365/cond ... ynamically

ching29
Posts: 15
Joined: Thu Mar 13, 2014

07 Aug 2014

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

User avatar
schuess
Posts: 82
Joined: Wed Jan 22, 2014

14 Dec 2015

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.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

15 Dec 2015

Please, use the code below:

Code: Select all

if (fd.field('InternalName').value().length == 0) {
…
}

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests