How to display a image on a form

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
Gerald Marxer
Posts: 6
Joined: Tue Dec 02, 2014
Contact:

08 Oct 2014

i have the url of an imge in a "url field".

On the display form i want to show this image as a thubnail picture.

There is no picture control.

How can a accomplish this ? May with the html control ?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

09 Oct 2014

Hi Gerald,

You can either switch "Format URL as" property in Picture in the column settings or drop HTML control onto the form, set CDATA property in False and put the following code into its Content property:

<img src="{@Hyperlink}" width="100" height="100" />

Please, replace Hyperlink with the internal name of your URL field.

Phoenix
Posts: 23
Joined: Wed Dec 10, 2014

08 Apr 2015

How can i dynamically change the image based on a onchang handler?

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

09 Apr 2015

Hi,

Please, assign an ID to the IMG tag:

Code: Select all

<img id="my-img" src="image1,jpg" width="100" height="100" />
Next, change src attribute via JavaScript:

Code: Select all

$('#my-img').attr('src', 'image2.jpg');

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 16 guests