Attachments upload field and submit button

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
aran.shearsby
Posts: 8
Joined: Mon Nov 27, 2017

28 Nov 2017

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

aran.shearsby
Posts: 8
Joined: Mon Nov 27, 2017

28 Nov 2017

Update - This only works when editing an item, it doesn't work when viewing - Is there any way around this?

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

29 Nov 2017

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

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests