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.
1 Answer
Here are the steps given below to add the attachment field in the SharePoint custom form.
- Open the Custom Form (either it is edit or new item) in the SharePoint Designer.
- 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:
- Open your site url in SPD.
- Click on "All files" from the left navigation tab.
- Click on Lists.
- Click on your Discussion board list.
- Right click on NewItem.aspx and "Check out" if it is available and then click on "Edit file in advanced mode".
- From the UI, by inspect element find out after which field the attachment should be placed.
- Search that field in the NewItem.aspx page in SPD and paste the above code after it.
- 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? Commented Oct 15, 2018 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. Commented Oct 15, 2018 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. Commented Oct 16, 2018 at 3:51