Answers.Body: <p>Not terribly familiar with Sprout Forms, but it looks like you could gate the download with a query string parameter, like in Sprout Forms' <a href="https://sprout.barrelstrengthdesign.com/craft-plugins/forms/docs/examples/adding-a-thank-you-page" rel="nofollow noreferrer">Thank you Page example</a></p>
  
  <p>Example:</p>
  
  <p>Add this to your form:</p>
  
  <p><code>&lt;input type="hidden" name="redirect" value="/DOWNLOAD_PAGE?submitted=true"&gt;</code></p>
  
  <p>and then in your download link template:</p>
  
  <pre><code>{% if craft.request.getParam('submitted') == 'true' %}
      DOWNLOAD_LINK
  {% else %}
      Please submit the form here LINK_TO_YOUR_FORM to access this whitepaper.
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-04T20:47:54.717Z
Answers.LastActivityDate: 2017-01-04T20:47:54.717Z
Answers.UserDisplayName: Sam LeBlanc
Body: <p>I have a white paper PDF file that I want visitors to be able to download, but only after they've submitted a form with their contact information. How can I do this in Craft?</p>
  
  <p>Currently, I'm using the Sprout Forms plugin to build a form, and I've set the redirect for the form to a template containing the download link. This does work, but seems clunky, and any visitor who has the URL for the download page can visit it without submitting the form.</p>
  
  <p>How can I require a form submission before displaying the template with the download link to the visitor?</p>
  
Tags: <plugin-sproutforms>
Title: How to require form submission before template display?
ThreadText: # How to require form submission before template display?
  
  (Asked by: username_0 on 2017-01-03)
  
  I have a white paper PDF file that I want visitors to be able to download, but only after they've submitted a form with their contact information. How can I do this in Craft?
  
  Currently, I'm using the Sprout Forms plugin to build a form, and I've set the redirect for the form to a template containing the download link. This does work, but seems clunky, and any visitor who has the URL for the download page can visit it without submitting the form.
  
  How can I require a form submission before displaying the template with the download link to the visitor?
  
  **Tags:** plugin-sproutforms
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-01-04. Score: 1
  
  Not terribly familiar with Sprout Forms, but it looks like you could gate the download with a query string parameter, like in Sprout Forms' [Thank you Page example](https://sprout.barrelstrengthdesign.com/craft-plugins/forms/docs/examples/adding-a-thank-you-page)
  
  Example:
  
  Add this to your form:
  
  `<input type="hidden" name="redirect" value="/DOWNLOAD_PAGE?submitted=true">`
  
  and then in your download link template:
  
  ```
  {% if craft.request.getParam('submitted') == 'true' %}
      DOWNLOAD_LINK
  {% else %}
      Please submit the form here LINK_TO_YOUR_FORM to access this whitepaper.
  {% endif %}
  
  ```
  
  
  ---
  
  