Preventing Competitors from Accessing Content on Form Submission


You may wish to block competitors from submitting forms in order to access your content such as white papers or data sheets. By inserting some Javascript into your form’s Thank You Code, you can redirect them to a different page that will prevent them from 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("")!=-1){ //if the string has the competitor name
        top.location="http://loc1"; //redirect to a location
      } else if (email.indexOf("")!=-1){
      } else { //go to the real location
  • Replace the following content with specified information:
    • – the first competitor’s email domain
    • http://loc1 – if the first competitor submits the form, they will be redirect to this website
    • – 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("")!=-1){
  • This does not cancel the form submission. Completion actions (such as autoresponse emails) will still take place. This code will redirect competitors to a different success location from prospects. To prevent competitors from downloading or accessing content, it would be best to have it viewable as a success location for prospects and not provide download links in 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.

Read Next

Asset chooser added to all WSYWYG Editors

Ready to see how marketing automation can help you grow at record speeds?
Request a personalized demo today!
Need help?No problem. Chat with our sales experts or call us at 1-800-667-6389.