How to create rules on attachments

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Jdubs
Posts: 73
Joined: Fri Dec 19, 2014

18 Mar 2015

How do you check if Attachment field is null?

I tried manipulating various attributes of the code you provided here, but nothing worked:

viewtopic.php?f=4&t=132
viewtopic.php?f=1&t=405

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

19 Mar 2015

Hi,

This code works perfectly for me:

Code: Select all

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
Posts: 73
Joined: Fri Dec 19, 2014

19 Mar 2015

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!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests