title: Django dynamic Form example
body: <p>I have a simple requirement for creating a dynamic form in Django - I've seen many examples but they seem to be incomplete, or require more extensive knowledge of Python and Django than I have!  None show how the dynamic portion of the example should be called:  </p>
  
  <p>This is the form class with Q1 and Q2 - I place a button on the form to add another
  field called Q3 - and then Q4 if pressed again:  I think I got the <strong>init</strong> function semi correct:</p>
  
  <pre><code>class testform(forms.Form):
      Q1 = forms.CharField()
      Q2 = forms.CharField()
  
      def __init__(self, *args, **kwargs):
          super(testform,self).__init__(*args,**kwargs)
          self.fields['Q%s'%i] = forms.CharField(label='Q%i' % i)
  </code></pre>
  
  <p>I want to place a button on the form to add another
  field called Q3 and then Q4 if pressed again.  </p>
  
  <ul>
  <li>How do I call the _<em>init</em>_function from the view to add these fields?</li>
  <li>If I use Javascript to add the field dynamically, how do I call <strong>init</strong> so that I can correctly validate with Django when I POST the form? </li>
  </ul>