Whenever we have a custom list form web part in an aspx page (in new/edit/display mode), the "Attach" link doesn't work. It gives an error. Refer the following Microsoft KB article for the error and its resolution.
http://support.microsoft.com/kb/953271
Showing posts with label Attachment Issues in Custom List Form. Show all posts
Showing posts with label Attachment Issues in Custom List Form. Show all posts
Monday, February 15, 2010
Attachment Required Validation for Custom List Form in SharePoint Designer 2007
I have a Custom List Form for Edit Item in a custom aspx page developed using SharePoint Designer. There was a requirement in this. There should be a check for attachments,i.e. attachments should be made mandatory. This had to be achieved through Javascript. The following function helped in achieving the same. Note: This function should be called in the OnSubmit event of the form. Also, don't change the
id "idAttachmentsTable"
function CheckForAttachments()
{
var elm = document.getElementById("idAttachmentsTable");
if (elm == null || elm.rows.length == 0)
{
//document.getElementById("idAttachmentsRow").style.display='none';
alert("Please attach Documents");
return false ;
}
else { return true ;}
}
id "idAttachmentsTable"
function CheckForAttachments()
{
var elm = document.getElementById("idAttachmentsTable");
if (elm == null || elm.rows.length == 0)
{
//document.getElementById("idAttachmentsRow").style.display='none';
alert("Please attach Documents");
return false ;
}
else { return true ;}
}
Subscribe to:
Posts (Atom)