title: How to download PDF after fadeout the success message?
body: <p>I am using a form to submit email and name to the user. After submitting the form email triggered and success message displaying. Success message fade-out after 10 seconds i.e. fine.  Now I want to download a pdf also after fadeout success message.</p>
  
  <p>I am achieving this via action.</p>
  
  <p>I am using below code:</p>
  
  <pre><code>&lt;form class="brochure brochure_1" method="post" id="custom_contact_form" action="http://example.com/contact/index/contact" onsubmit="return validateForm();" name="myForm"&gt;
          &lt;div class="input-box"&gt;
              &lt;input type="hidden" readonly="readonly" class="input-text required-entry toname" value="" name="toname"/&gt;
              &lt;input type="hidden" value="&lt;?php echo $this-&gt;getFromUrl(); ?&gt;" name="submiturl" class="submiturl" /&gt;
          &lt;/div&gt;
              &lt;input type="text" class="input-text required-entry" value="" name="name" placeholder="Name"/&gt;
              &lt;input type="text" class="input-text required-entry" value="" name="email" placeholder="Email"/&gt;
          &lt;span&gt;&lt;input type="submit" value="Download" /&gt;&lt;/span&gt;
      &lt;/form&gt;
  &lt;script&gt;
  function validateForm() {
      var name = document.forms["myForm"]["name"].value;
      if (name == "") {
          alert("Name must be filled out");
          return false;
      }
  
      var email = document.forms["myForm"]["email"].value;
      var atpos = email.indexOf("@");
      var dotpos = email.lastIndexOf(".");
      if (email == "") {
          alert("Email must be filled out");
          return false;
      }
      else if (atpos&lt;1 || dotpos&lt;atpos+2 || dotpos+2&gt;=x.length) {
          alert("Not a valid e-mail address");
          return false;
      }
  }
  
  jQuery('.success-msg').insertBefore(jQuery( ".breadcrumbs" ));
   jQuery(document).ready(function(){
          setTimeout(function() {
            jQuery('.success-msg').fadeOut('fast');
          }, 10000); // &lt;-- time in milliseconds
      });
  &lt;/script&gt;
  </code></pre>