Page 1 of 1

Attachments upload field and submit button

Posted: 28 Nov 2017
by aran.shearsby
I have seen a few old posts about adding an attachment upload field complete with submit button (http://forum.spform.com/forms-designer- ... ton-10088/):

Code: Select all

<div height="15" id="attachmentsOnClient" style="float:left;">
<span dir="ltr">
<input type="file" name="fileupload0" id="onetidIOFile" size="56" title="Name" />
</span>
</div>
<div>
<input id="attachOKbutton" type="BUTTON" onclick='OkAttach()' value="Upload" style="width: 12.8em; height: 3em"/>
<span id="idSpace"/>
</div>
I have copied the HTML into my form and can see the field and save button fine. I can also select a file from my computer to upload, but when clicking the upload button it doesn't seem to do anything.

Can you confirm if i am missing something or if there is a better way of doing this?

Thanks in advance

Re: Attachments upload field and submit button

Posted: 28 Nov 2017
by aran.shearsby
Update - This only works when editing an item, it doesn't work when viewing - Is there any way around this?

Re: Attachments upload field and submit button

Posted: 29 Nov 2017
by Nikita Kurguzov
Hello, Aran!
Display Form can only be used for viewing items. This is how SharePoint is built and not much can be done about it. Any changes, including adding Attachments to an item, should be handled through Edit Form.