How to create rules on attachments

rss

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 Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 2 months 22 days
    #1 by Dmitry Kozlov Mar 19 ’15 at 07:27

    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.

  • Jdubs
    Member
    Member for: 4 years 11 months 23 days
    #2 by Jdubs Mar 19 ’15 at 02:09

    [#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