Mustafa_s
Member
Hello,
I have a file upload element in a repeatable group. The element works fine for the most part but I have a few questions:
1) How can I make the links in the file upload element open in a new window in details view? I tried the following code in the elements Javasvript on Load but that made all links open in a new window. How can I ensure only the links from the file upload element open in a new window? As it stands every attachment type opens in a new window except PDFs.
2) When I download files in details view such as ZIP files, everything is ok. The file get's download and I'm able to continue inside the website. But when I open PDFs (which open in the same window) and click back to go to the details view again I'm presented with the Joomla login window. The user gets disconnected each and every single time they view the PDFs. I dont think I want to use the download script as I would like to see the file name of the attached file.
My setup is as follows:
I have a file upload element in a repeatable group. The element works fine for the most part but I have a few questions:
1) How can I make the links in the file upload element open in a new window in details view? I tried the following code in the elements Javasvript on Load but that made all links open in a new window. How can I ensure only the links from the file upload element open in a new window? As it stands every attachment type opens in a new window except PDFs.
Code:
window.onload = function(){
var anchors = document.getElementsByTagName('a');
for (var i=0; i<anchors.length; i++){
anchors[i].setAttribute('target', '_blank');
}
}
2) When I download files in details view such as ZIP files, everything is ok. The file get's download and I'm able to continue inside the website. But when I open PDFs (which open in the same window) and click back to go to the details view again I'm presented with the Joomla login window. The user gets disconnected each and every single time they view the PDFs. I dont think I want to use the download script as I would like to see the file name of the attached file.
My setup is as follows: