title: How to handle multiple forms in one function in views in Django
body: <p>I have to handle two forms in one function:</p>
  
  <h1>HTML page</h1>
  
  <pre><code>&lt;form name="selectgenderform" method = "POST"&gt;
    &lt;select name='gender'&gt;
     &lt;option&gt;Male&lt;/option&gt;
     &lt;option&gt;Female&lt;/option&gt;  
    &lt;/select&gt;
   &lt;input type = 'submit' name ='searchbtn' value= 'search' &gt;
  &lt;/form&gt;
  
  
  &lt;form name="selectionform" method = "POST"&gt;
    &lt;input type = 'hidden' name = 'valueofnumber' &gt;
   &lt;input type = 'submit' name = 'searchbtn' value= 'search' &gt;
  &lt;/form&gt;
  </code></pre>
  
  <h1>Views.py</h1>
  
  <pre><code> def formselection(request):
     if selectgenderform in request.POST:
       gender = request.POST.get('gender')
       ...
  
     elif selectionform in request.POST:
       value = request.POST.get('valueofnumber') 
  </code></pre>
  
  <p>My query is to handle multiple forms in one function but this will not according to my demand</p>