Friday, April 11, 2014

Save Wiki Library as a Template in Sharepoint 2010

When going into Library Settings on a Wiki Library Template, I noticed the “Save Library as Template” option was missing.

Found a workaround by changing the URL in this way:
Change the “listedit.aspx” filename in the URL to “savetmpl.aspx” instead…

Friday, April 4, 2014

Make attachment required field in SharePoint List/ Library

<script type="text/javascript" language="javascript">
function PreSaveAction()
{
  var elm = document.getElementById("idAttachmentsTable");
    if (elm == null || elm.rows.length == 0)
 {
       document.getElementById("idAttachmentsRow").style.display='none';
  alert("Please Attach File");
  return false ;

 }
 else {
 return true ;
 }
 return true ;
}
</script>
--------------------------------------------
If need confirmation box. Please use the below code

function PreSaveAction()
{
      var elm = document.getElementById("idAttachmentsTable");
               if (elm == null || elm.rows.length == 0)
            {
var r=confirm("Do you want to attach the file?");
if(r==true)
        {
return false;
}
  else
{
return true;

}

                }
      else
{
return true;
}

     return true ;
}