title: Submit on click in dropdown with Django
body: <p>I have a field in my User model in Django specifying the user type.</p>
  
  <p>On all my pages I want a dropdown or select in which I can choose another user type.</p>
  
  <p>I could make links for each user type and change the user type in a new view, e.g. <code>&lt;a href="/change-user-type/type-1"&gt;Change to type 1&lt;/a&gt;</code>, but I've read that such changes should always happen through a post request.</p>
  
  <p>What would be the best approach to this problem? Can I create the links and use</p>
  
  <pre><code>&lt;form method="post" action="/change-user-type/"&gt;
      &lt;a href="#" class="type-1" onclick="this.submit"&gt;Change to user type 1&lt;/a&gt;
      &lt;a href="#" class="type-2" onclick="this.submit"&gt;Change to user type 2&lt;/a&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>or can I add a ModelForm to the context data, outputting a <code>&lt;select&gt;</code>, automatically appending all possible choices?</p>
  
  <p>I want something like the functionality as when I can choose to use Facebook as a page from the dropdown menu.</p>