‹ Back to Knowledge Base home


You may wish to block competitors from accessing the content you’ve hidden behind forms, such as white papers or data sheets. By inserting some Javascript into your forms’ Thank You Code, you can redirect your competitors to a different page after they submit the form, which will prevent them from accessing and downloading your content.


  • Go to Marketing > Forms
  • Either edit an existing form or create a new form
  • During Step 4 (“Completion Actions”) of the Form Wizard, click on the Thank You Code tab
  • Copy and paste the following code in the text area field:
    <script type="text/javascript">
      var email = "%%email%%"; //set the field name to a local javascript variable
      if (email.indexOf("@competitor1.com")!=-1){ //if the string has the competitor name
        top.location="http://loc1"; //redirect to a location
      } else if (email.indexOf("@competitor2.com")!=-1){
      } else { //go to the real location
  • Replace the following content with specified information:
    • @competitor1.com – the first competitor’s email domain
    • http://loc1 – if the first competitor submits the form, they will be redirect to this website
    • @competitor2.com – the second competitor’s email domain
    • http://loc2 – the redirect location for the second competitor (may be the same as the first redirect)
    • http://nonCompetitorLocation – where your prospects (non-competitors) will be directed after successful form completion (such a download page for a white paper)
  • If editing an existing form, press Finish to save. If creating a new form, press Next to go to the confirmation page and then press Finish to save.


  • Have more than two competitors you would like to redirect? Simply copy the following line of code after the line with “http://loc2″:
      } else if (email.indexOf("@competitor3.com")!=-1){
  • This does not cancel the form submission. Completion actions (such as autoresponse emails) will still fire. This code will simply redirect competitors to a different success location than the one regular prospects see after the form is submitted. To prevent competitors from downloading or accessing your content, remember to also avoid linking to it within your form’s autoresponse emails.
  • This presumes that competitors will use their work email address while filling out a form on your website. You can block email from ISPs and free email providers by editing your existing email form fields:
    • When creating your form under Marketing > Forms, select your email prospect field
    • Edit, and from the Data Format drop down, select Email not from ISPs and free email providers
    • Press Save form field

    This will require anyone filling out this form to provide a business or organization email address. If you would like to have an email prospect field that would allow people to submit personal email address, you can have two different fields (one with the ISPs and free email addresses blocked and one with valid emails). Please check out our Form Fields article for more information.