Question

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.

Was it helpful?

Solution

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.

<tr>
<td width=”190px” valign=”top” class=”ms-formlabel”>
<h3 class=”ms-standardheader”>
<nobr>Attach Files</nobr>
</h3>
</td>
<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>
</span>
</td>
<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>
</td>
</tr>

Add attachment button to a custom new form SharePoint 2013

Update:

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".
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top