Add Attachment Field in SharePoint 2013 List Form

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

Solution:

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

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

add attachment field to sharepoint form

Salaudeen Rajack

Information Technology Professional with Two decades of SharePoint Experience.

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

  • January 7, 2021 at 4:51 AM

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

    Reply
  • November 8, 2018 at 7:55 PM

    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

    Reply
  • January 23, 2018 at 4:16 AM

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

    Reply

Leave a Reply