Add an attachments field and submit button
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>
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Thank you very much for the usefull information!
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!
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests