Opening attachments on list form in new tab
AnsweredHi everyone
I have a list form where users can add attachments. When they open the display form that has attachments on there, clicking the attachment opens it in the same window as the form. I wondered how I can get the attachments to open in a new tab or window instead. I've tried adding the following to my form but it doesn't seem to be working:
$(document).ready(function(){
$("table#idAttachmentsTable a").click(function () {
var url=$(this).attr('href');
window.open(url, '_blank');
});
});
Does anyone have any advice on what I'm doing wrong, or another way of achieving this?
Thanks in advance for your help.
-
Hi Gareth Jayne,
on those attachment links there are two attributes (onmousedown & onclick) which prevent the target="_blank".
You can use an execute script form load actions to remove them and add the target like this:
ArdeviaJQuery('#idAttachmentsTable a').each(function () {
ArdeviaJQuery(this).attr('target','_blank');
ArdeviaJQuery(this).removeAttr("onmousedown");
ArdeviaJQuery(this).removeAttr("onclick");
});BR Matthias
0 -
Great thanks for your help Matthias.
0
Please sign in to leave a comment.
Comments
2 comments