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.
- 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>
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".