title: How to add fields to activeform with js/jQuery in Yii2?
body: <p>Hi I have a user form and I want to add a button so that the user can add more contacts dynamically.</p>
  
  <pre><code>&lt;form id="user-form"&gt;
  &lt;div id='dynamicInput'&gt;
      &lt;div&gt;&lt;input type='text' placeholder='name'&gt;&lt;/div&gt;
      &lt;div&gt;&lt;input type='text' placeholder='email'&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;input type='button' id='btnadd' value="add contact"&gt;
  &lt;input type='submit'&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>If I wasn't using the Framework I would do something like this <a href="http://jsfiddle.net/3t06fL3f/" rel="nofollow">http://jsfiddle.net/3t06fL3f/</a>
  (this is based on very old code) :)</p>
  
  <p>But using Yii2 I'm not sure how to accomplish this, I'm new to yii2 and frameworks in general.</p>
  
  <p>Thank you in advance. :)</p>