Page 1 of 1

Add an attachments field and submit button

Posted: 21 Oct 2013
by MES5464
I found the following code that if pasted into an HTML control it will provide an file selection field for the user to select a file to attach to a list item, and an OK button that will then attach the file to the list item. It seems to work great.


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

Re: Add an attachments field and submit button

Posted: 22 Oct 2013
by Dmitry Kozlov
Thank you very much for the usefull information!

Re: Add an attachments field and submit button

Posted: 16 Jan 2015
by hp
How do i get attachment attached to list item? i have added html to my form, it display browse and upload buttons. it also fatched the file from system. My only question is what do i write on upload button to attach file to item. thanks in advance. and by the way this is awesome!

Re: Add an attachments field and submit button

Posted: 16 Jan 2015
by hp
This works now. :) and i will say again its great