title: Identify which submit button was clicked in Django form submit
body: <p>In Django I would like to have a form with 2 submit button options. "save &amp; home" and "save &amp; next".</p>
  
  <p>Any thoughts how I can identify which submit button was clicked in my view?</p>
  
  <p>I'm fairly new to programming/working with forms and appreciate the feedback.</p>
  
  <p><strong>Form</strong></p>
  
  <pre><code>&lt;form action="{% url 'price_assessment_section_1' component.id %}" method="post"&gt; {% csrf_token %}
  
   {{ form.s1_q5_resin_type }}
  
   &lt;!-- FORM SUBMIT BUTTONS--&gt;
  
   &lt;button type="submit" &gt;&amp;nbsp;Save&amp;Home&lt;/button&gt;
  
   &lt;button type="submit" &gt;&amp;nbsp;Save&amp;Next&lt;/button&gt;
  
  &lt;/form&gt; &lt;!-- end form--&gt;
  </code></pre>
  
  <p><strong>View</strong></p>
  
  <pre><code>@login_required
  def price_assessment_section_1(request, component_id):
  
      component = Component.objects.get(id=component_id)
  
      if request.method == 'POST':
          form = PriceAssessmentSection1(request.POST)
  
                  # if "save &amp; home" go to: return HttpResponseRedirect(reverse('portal_home'))
  
                  # if "save &amp; next" go to: return HttpResponseRedirect(reverse('portal_sec2'))
  
      form = PriceAssessmentSection1()
      return render(request, 'portal/price_assessment_section_1.html', {'form': form, 'component':component})
  </code></pre>