Add an attachments field and submit button
Posted: 21 Oct 2013
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>
<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>