Monday, 20 April 2015

How to make attachment mandatory in SharePoint list form?

Using a list item it is not possible to make the attachment required out of the box. To make this field mandatory we will need to add JavaScript on list form.

Below is the java script which will make attachment field mandatory on list form

<script type="text/javascript" language="javascript">
function PreSaveAction() 

    var elm = document.getElementById("idAttachmentsTable");
    if (elm == null || elm.rows.length == 0)

       alert("Please attach Documents");
       return false ;
      return true ;

Hope this helps.


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...