Href not dowloading document

On this page they are a few buttons (see print screen below) used to download a document. Can’t figure why they don’t work I tried adding the download tag or play with the z-index and couldn’t figure out why

2020-12-04_15-04-05

It looks like you have Bootstrap’s button component preventing the default click action from happening. Your PDF won’t open because of that.

There are a few ways you could go about it. The best way is to unwrap your anchor tag from this

<div class="btn-group product-item-size" data-toggle="buttons"> <!-- This element is what's causing the issue

And then style your anchor tag to look like a button. You can use the Bootstrap button classes to do it so the btn class there.

Now if for whatever reason you need that exact markup, another way you could go about it is to add the following attribute to your anchor tag:
onclick="window.location.href = 'Docs/Documentos/Documentos_314143327000.pdf';", as it follows:

<div class="btn-group product-item-size" data-toggle="buttons">
  <label class="btn">
    <a href="Docs/Documentos/Documentos_314143327000.pdf" onclick="window.location.href = 'Docs/Documentos/Documentos_314143327000.pdf'">Información Técnica PolySpec Flex FR</a>
  </label>
  ...
</div>
2 Likes

Thank you Mateus, not proud to say it is the 2nd time it happened and I couldn’t remember the fix I used before. Case solved :slight_smile:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.