Pictures on the display form
Hi, is there a way to show attachment on the form as pictures? For example: I have 1 or several pictures attached to the item and I want on them to be visible on the display form as a preview / thumbnails. There would be of course different pictures attached to different items.
Found this code and it works:
(function(){
var b=document.getElementById('idAttachmentsTable');
if(b){
var c=b.getElementsByTagName('A'),a,d;
for(var i=0,l=c.length;i<l;i++){
a=c;
if(!(new RegExp('\.jpg|\.jpeg|\.png|\.gif|\.bmp|\.tif|\.tiff','i').test(a.href)))continue;
d=document.createElement('img');
d.style.width='250px';
d.style.border='0';
d.src=a.href;
a.appendChild(document.createElement('br'));
a.appendChild(d)
}
}
})();
In case someone would need it
(function(){
var b=document.getElementById('idAttachmentsTable');
if(b){
var c=b.getElementsByTagName('A'),a,d;
for(var i=0,l=c.length;i<l;i++){
a=c;
if(!(new RegExp('\.jpg|\.jpeg|\.png|\.gif|\.bmp|\.tif|\.tiff','i').test(a.href)))continue;
d=document.createElement('img');
d.style.width='250px';
d.style.border='0';
d.src=a.href;
a.appendChild(document.createElement('br'));
a.appendChild(d)
}
}
})();
In case someone would need it
- AlexStenAlexSten
- Posts: 31
- Joined: Fri Apr 07, 2017
Hi Katy,
thank you for posting this code. Very helpful.
Do you know if it is possible to have also a preview of PDF files in the form?
thank you
thank you for posting this code. Very helpful.
Do you know if it is possible to have also a preview of PDF files in the form?
thank you
ciao,
Ale Stendardo
Ale Stendardo
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests