Check if People Picker field is empty.
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 KozlovAdminMember for: 9 years 8 months 16 days
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
-
ching29MemberMember for: 9 years 2 months 27 days
Thanks for this Dmitry.. It really helped...!
-
schuessMemberMember for: 9 years 4 months 15 days
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 KozlovAdminMember for: 9 years 8 months 16 days
[#3]: Please, use the code below:
if (fd.field('InternalName').value().length == 0) { … }
-
Goldyy6MemberMember for: 1 year 8 months 26 days
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.