Wednesday 17 January 2018

Make attachment mandatory in SharePoint list form

Process:
1. Go to the SharePoint "Default New Form"

2. Edit the page.
3. Add a script editor web part.
4. Add the below script to the web part and close.

<script type="text/javascript" language="javascript">

function PreSaveAction() {
    if (document.getElementById('idAttachmentsRow').style.display=='none' )
    {
        alert('Attachment is Mandatory! Please attach Documents.');
        return false ;
    }
    elsereturn true;  }
}

</script>

------------------------------------End------------------------------

No comments:

Post a Comment