I have a discussion board and I want the users to have the ability to add attachments to their post. I know that this can be done through the ribbon but I was looking for a way to put it into the form so it is used more, or easier for the less technical users to find and use. Has anyone else done this? The searches I have tried have not yielded any useful results.


Here are the steps given below to add the attachment field in the SharePoint custom form.

  1. Open the Custom Form (either it is edit or new item) in the SharePoint Designer.
  2. Identify the place and paste the following code in SPD.

<td width=”190px” valign=”top” class=”ms-formlabel”>
<h3 class=”ms-standardheader”>
<nobr>Attach Files</nobr>
<td valign=”top” class=”ms-formbody” id=”attachmentsOnClient” style=”width: 434px”>
<span dir=”ltr”>
<input type=”file” name=”fileupload0″ id=”onetidIOFile” size=”56″ title=”Name”></input>
<td width=”100px” valign=”top” class=”ms-formbody”>
<input name=”Button1″ type=”button” value=”Attach” onclick=’OkAttach()’ style=”width: 6em;
height: 1.7em” />
<span id=”idSpace”></span>

Add attachment button to a custom new form SharePoint 2013


To open Discussion board OOTB NewItem.aspx and edit follow below steps:

  1. Open your site url in SPD.
  2. Click on "All files" from the left navigation tab.
  3. Click on Lists.
  4. Click on your Discussion board list.
  5. Right click on NewItem.aspx and "Check out" if it is available and then click on "Edit file in advanced mode".
  6. From the UI, by inspect element find out after which field the attachment should be placed.
  7. Search that field in the NewItem.aspx page in SPD and paste the above code after it.
  8. Save the file and "Check in".
  • I am not using SP designer, so how do I do this if I am using the OOB form for a discussion board, I have not created a custom form? Or do i need to create a custom form for this to work? – Gary Peters Oct 15 '18 at 18:33
  • I have tried to add a new column and made it a Multi Line text box opened the newitem.aspx page and tried to embed the code in the Text box but that did not work. So I added script editor and pasted the code there and I can see where to attach an item but it does not work, I am not sure what I am missing. – Gary Peters Oct 15 '18 at 18:45
  • Open your OOTB NewItem.aspx form in the SPD and paste the code accordingly. I have added the steps above on how to edit OOTB form in SPD. – Sohail Shaikh Oct 16 '18 at 3:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.