How to make SharePoint Attachment required

List item attachment in many cases needs to be required and at the same time the developer doesn’t want to edit the form using SharePoint designer. The trick is pretty easy, just edit the newForm.aspx to the list in browser and add content editor. Then, copy and paste the following script.

Note: you can change the message in the alert

<script type="text/javascript" language="javascript">
function PreSaveAction() {
if (document.getElementById('idAttachmentsRow').style.display=='none' )
     alert('Attachment is Mandatory! Please attach Documents.');
     return false ;
else {  return true;  }

Enjoy the required attachment with the alert.

2 Replies to “How to make SharePoint Attachment required”

  1. This is my first time pay a visit at here and i am truly pleassant to read everthing at alone place. Sarette Bartolomeo Beaver

  2. Greetings! Very helpful advice within this article! It is the little changes that will make the biggest changes. Thanks for sharing! Corabelle Carey Middleton

Comments are closed.