Greg T
Greg T

Reputation: 11

Redirect after clicking download link in html

I have a link in my page that downloads a PDF file however after they have clicked either of the download links, I would like to take them to another page.

The page gives them one of 2 choices for selecting a download file but I only wish to allow them to make one choice and then exit to another page.

My code is as follows:

<div class="columns medium-6">
    <h3 class="text-center">7 Tips for Creating a <br />Happy Workplace</h3> <img src="https://www.maylake.com.au/_assets/images/mini-guide/bookcover-7-tips-workplace.png" height="250px" alt="7 Tips for Creating a Happy Workplace eBook">
    <p style="font-size: 18px;" class="text-center">Discover how you can make your workplace a healthier environment by simply making being a happy place to work for everyone</p>
    <div class="choose">
        <input type="radio" name="choice-books" id="choice-7-tips">
        <label>I would like to receive a copy of the eBook</label>
        <div class="reveal-if-active">
            <p class="text-center"><a href="/LiteratureRetrieve.aspx?ID=192014" class="button radius text-center">DOWNLOAD Now</a> </p>
        </div>
    </div>
</div>
<div class="columns medium-6">
    <h3 class="text-center">Your Short Guide to Leasing a Commercial Office Space</h3> <img src="https://www.maylake.com.au/_assets/images/mini-guide/bookcover-leasing-commercial-office.png" alt="Guide to Leasing Commercial Office" height="250">
    <p style="font-size: 18px;" class="text-center">Understand what you should be considering before leasing any commercial office space. Being forewarned and prepared could save you lots
        of money and grief</p>
    <div class="choose">
        <input type="radio" name="choice-books" id="choice-leasing">
        <label for="choice-leasing">I would like to receive a copy of the eBook</label>
        <div class="reveal-if-active">
            <p class="text-center"><a href="/LiteratureRetrieve.aspx?ID=192012" class="button radius text-center">DOWNLOAD Now</a> </p>
        </div>
    </div>
</div>

Upvotes: 0

Views: 1614

Answers (1)

Sam
Sam

Reputation: 6170

I would change your a elements to something like this:

<a target="_blank" href="/LiteratureRetrieve.aspx?ID=192014" class="button radius text-center" onclick="window.location='http://google.com';">DOWNLOAD Now</a> 

This will take them to google.com at the same time they are downloading the pdf.

Upvotes: 1

Related Questions