Search This Blog

Monday 9 September 2013

Check for Attachment Missing in a list form using Javascript


Add below javascript in a content editor. While clicking 'Save' button PreSaveAction will be called automatically.

<script language="javascript" type="text/javascript">
function PreSaveAction()
{
var elm = document.getElementById("idAttachmentsTable");
if (elm == null || elm.rows.length == 0)
{
alert('Attachement missing');
return false;
}
return true;
}</script>

No comments:

Post a Comment