Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Add attachment button to a custom new form SharePoint 2013

$
0
0

I'm creating a new custom form using SharePoint Designer 2013.

I would like to add a attachment button to be able to upload files and images. How can this be done?

See code below

<tr><td width="190px" valign="top" class="ms-formlabel"><h3 class="ms-standardheader"><nobr>Attach Files</nobr></h3></td><td valign="top" class="ms-formbody" id="attachmentsOnClient" style="width: 434px"><span dir="ltr"><input type="file" name="fileupload0" id="onetidIOFile" size="56" title="Name"></input></span></td><td width="100px" valign="top" class="ms-formbody"><input name="Button1" type="button" value="Attach" onclick='OkAttach()' style="width: 6em;
height: 1.7em" id="attachOKbutton" /><span id="idSpace"></span></td></tr><tr id="idAttachmentsRow"><td nowrap="true" valign="top" class="ms-formlabel" width="20%"><SharePoint:FieldLabel ControlMode="New" FieldName="Attachments" runat="server"/></td><td valign="top" class="ms-formbody" width="80%"><SharePoint:FormField runat="server" id="AttachmentsField" ControlMode="New" FieldName="Attachments" __designer:bind="{ddwrt:DataBind('i','AttachmentsField','Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Attachments')}"/><script>
          var elm = document.getElementById(&quot;idAttachmentsTable&quot;);
          if (elm == null || elm.rows.length == 0)
          document.getElementById(&quot;idAttachmentsRow&quot;).style.display=&apos;none&apos;;</script></td></tr>

Im getting error :

  1. Uncaught TypeError: Cannot read property 'value' of undefined form.js?rev=PxBF2F2E04Ut1YUooXDAbg%3D%3D:1
    1. onclick

Somewhere around this line:

k=document.getElementsByName("RectGifUrl")[0];e.innerHTML='<span class="ms-delAttachments"><IMG SRC=\''+k.value+"'>&nbsp;<a href='javascript:RemoveLocal

Thanks in Advance


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>