0

I'm building a form purely in SharePoint Designer and unfortunately don't have Infopath at my disposal (business requirement).

I have listed the attachments available on the form using the following:

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

Above this I'd like to mimic Infopath's attachments button which shows the dialog for users to quickly attach a file (clicking the ribbon isn't as obvious to the user). This button:

enter image description here

How would I go about doing this?

3
+50
<input id="btnAttachFile" onclick="javascript:UploadAttachment();" type="button" value="Click here to attach a file">

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.