I was wondering if it is possible for an attachment to be displayed within the form i.e the user uploads an image in the attachment field and upon submission that image is displayed on the submit success page. 



    CommentAdd your comment...

    1 answer


      Hi Hannah,

      Yes this is possible, via the following steps.

      1. Add a text display to the success page
      2. Open the rich text dialog for the text display's label
      3. Click "Source" (this allows us to enter html)
      4. Paste this in:

        <img alt="My Image" data-ng-src="data.attachmentField.AttachmentManager[0].imageData"/>
      5. This is using angular's ng-src directive to dynamically insert the image from the attachment field.
        "attachmentField" is the ID of the attachment field item.
        "AttachmentManager" is an array of attachments inside of all attachment fields.
        Use the index to pick the attachment you want.
        "imageData" contains the base64 encoded image.

      Side Note: You could also do this using jQuery or vanilla JavaScript on an image widget and updating the src attribute dynamically. However the first approach is less work and will respond to updates in the data.

        CommentAdd your comment...