Add Attachment Field in SharePoint 2013 List Form

Requirement: Add attachment column to a custom new/edit form in SharePoint 2013.


Create new custom list forms for New and Edit in SharePoint designer 2013. Add this code to the custom list form in the location where you want the attachment field to appear.

<td colspan="2">
    <td style="width:170px">
       <b>Upload Approval E-Mails: </b>
    <td valign="top" class="ms-formbody" id="attachmentsOnClient">
     <input type="file" name="fileupload0"  id="onetidIOFile" size="50" title="Name">   </input>
    <input name="attachButton" type="button" value="Attach" onclick='OkAttach()'  />

Result: Here is the SharePoint custom edit form with the attachment field.

add attachment field to sharepoint form

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. Passionate about sharing the deep technical knowledge and experience to help others, through the real-world articles!

4 thoughts on “Add Attachment Field in SharePoint 2013 List Form

  • Any solution? I get the same error in SharePoint 2016.

  • After clicking the save the attachments button it will not shown attachment files in the bottom .this issue in SharePoint 2016.Any suggestions

  • Am able to upload a single file, however i try to attach 2 or more files i get an pop up – You must specify a non-blank value for file
    any idea how to fix it

  • why do i get a you must specify a non-blank value for file name [ok] popup message


Leave a Reply

Your email address will not be published. Required fields are marked *