title: Python Flask Submit Button Not Working
body: <p>I have two buttons on a page: follow and unfollow, the follow button is displayed if the user is not following a person and vice versa. I have the following code but for some reason only the unfollow button works. The follow button doesn't do anything - I click on it and nothing happens.</p>
  
  <pre><code>            if request.method == 'POST':
              if request.form['submit'] == 'Follow':
                  c.execute("INSERT INTO users_followers(username,following) VALUES(?,?)",(session['username'],username,))
              elif request.form['submit'] == 'Unfollow':
                  c.execute("DELETE FROM users_followers WHERE username = ? AND following = ?",(session['username'],username,))
              conn.commit()
              return redirect(url_for("profilepage",username=username))
  </code></pre>
  
  <p>HTML Code:</p>
  
  <pre><code>{%if profile[0][1] == current%}
  {%else%}
  {% if following == True %}
  &lt;form action="/profile/{{username}}" class="form" method="post"&gt;
      &lt;input class="btn btn--sm type--uppercase" name="submit" style="background: #e74c3c;border-color: #c0392b;color:white;width:100px;" type="submit" value="Unfollow"&gt;
  {%else%} 
      &lt;input class="btn btn--sm type--uppercase" name="submit" style="background: #4a90e2;border-color: #4a90e2;color:white;width:100px;" type="submit" value="Follow"&gt;
  {%endif%} 
  &lt;a class="btn btn--sm btn--primary-2 type--uppercase" href="#"&gt;&lt;span class="btn__text"&gt;Send Message&lt;/span&gt;&lt;/a&gt;
  &lt;/form&gt;
  {%endif%}
  </code></pre>