title: auto populating contact 7 form with link to anchor on same page
body: <p>I followed <a href="http://www.featheredowl.com/auto-populate-contact-form-7-input-fields-with-url-parameter/" rel="nofollow">this</a> tutorial to dynamically auto populate a form created with contact form 7.
  To auto fill the form I am making use of the plugin <a href="https://de.wordpress.org/plugins/contact-form-7-dynamic-text-extension/" rel="nofollow">Contact Form 7 Dynamic Text Extension</a>.</p>
  
  <p>First I appended the following function to the function.php</p>
  
  <pre><code>// chalet name for enquiry form
  function parameter_queryvars( $qvars ) {
      $qvars[] = 'chalet';
      return $qvars;
  }
  add_filter('query_vars', 'parameter_queryvars' );
  
  function echo_chalet() {
      global $wp_query;
          if (isset($wp_query-&gt;query_vars['chalet']))
          {
              print $wp_query-&gt;query_vars['chalet'];
          }
  }
  </code></pre>
  
  <p>The contact 7 form has a dynamic field for the subject:</p>
  
  <pre><code>[dynamictext enquiry-chalet "CF7_GET key='chalet'"]
  </code></pre>
  
  <p>With this I can for example use the same form with different subjects, which are automatically filled in depending on which link was clicked.
  The link only has to contain a query for chalet. </p>
  
  <p><code>www.mysitexyz.com/link/to/page/with/form.php?chalet=request</code></p>
  
  <p><code>www.mysitexyz.com/link/to/page/with/form.php?chalet=cancellation</code></p>
  
  <p>The form's subject is filled with "request" or "cancellation".
  This works fine. </p>
  
  <h3>Now I want to auto populate a form on the same page as the link.</h3>
  
  <p>The link contains an anchor now:
  <code>www.mysitexyz.com/link/to/page/with/form.php?chalet=chaletname#myFormDownHere</code></p>
  
  <p>Clicking the link, the page is scrolled down to the anchor. My wordpress theme smoothly scrolls down. But the field is not auto filled. Clicking the page with the browsers function to open in new tab works. Then the page is scrolled down to the anchor and the form field is correctly filled in. But this is not what people normally do.</p>
  
  <p>How can I achieve the same result with a normal click on the link?</p>