How to create rules on attachments
Posted by Jdubs - Mar 18 ’15 at 08:25
How do you check if Attachment field is null?
I tried manipulating various attributes of the code you provided here, but nothing worked:
- http://forum.spform.com/forms-designer-for-sharepoint-20/get-a-count-of-attachments-27280/
- http://forum.spform.com/forms-designer/attachments-22158/
Thanks!
-
Dmitry KozlovAdminMember for: 8 years 10 months 26 days
Hi,
This code works perfectly for me:
fd.onsubmit(function() { if ($('#idAttachmentsTable tr').length == 0) { alert('Please, add an attachment.'); return false; } return true; });
Please, make sure that you don't have JS errors or notifications in the browser console.
-
JdubsMemberMember for: 7 years 7 months 29 days
[#1]: Hmm. That worked for me.
I specifically used the the .length == 0 line of code and didn't trigger any console errors. Must have been a conditional error I kept overlooking.
Thanks so much!
Displaying 1 to 2 of 2 messages