title: WTForms/flaskforms not retrieving data properly via submit button
body: <p>So I'm just trying to get the submit button to work properly. 
  Work properly meaning to get the user input for email and password to be directed to my login.</p>
  
  <p>Currently, it only redirects to the index.html, but I want it to go result with a redirect to either profile or error.</p>
  
  <p>Here's the python part:</p>
  
  <p>@app.route("/login", methods=["GET", "POST"])</p>
  
  <p>def login():</p>
  
  <pre><code>"""Log user in if credentials provided are correct."""
  
  form = LoginForm(request.post)
  
  # this is if its POST
  if form.validate and request.method == 'POST':
      email = request.form['email']
      password = request.form['password']
  
      if email == admin@gmail.com" and password == "admin":
          return redirect(url_for('/home'))
      else:
          return redirect(url_for('/error'))
  # this is if its GET
  #return render_template("index.html", form=form)
  </code></pre>
  
  <p>This is the login form</p>
  
  <p>class LoginForm(FlaskForm):</p>
  
  <pre><code>email = StringField('email', validators=[InputRequired()])
  password = PasswordField('password', validators=[InputRequired()])
  remember = BooleanField('remember me')
  </code></pre>
  
  <p>Here's the html part:</p>
  
  <pre><code>&lt;div class="modal-body"&gt;
                  &lt;form role="form"&gt;
                      &lt;div class="form-group"&gt;
                          &lt;div class="input-group"&gt;
  
                              &lt;form method="POST" action="{{ url_for('login')}}"&gt;
                                  {{ form.csrf }}
                                 &lt;dl style="width: 100%;"&gt;
                                      &lt;div class="form-group"&gt;
                                          &lt;form role="form"&gt;
                                              &lt;div class="form-group"&gt;
                                                  &lt;div class="input-group"&gt;
                                                      {{ wtf.form_field(form.email) }}
                                                      {{ wtf.form_field(form.password) }}
                                                  &lt;/div&gt;
                                              &lt;/div&gt; &lt;!-- /.form-group --&gt;
                                          &lt;/form&gt;
                                      &lt;/div&gt; &lt;!-- /.form-group --&gt;
  
                                      &lt;div style="margin-left: 70%;" class="checkbox"&gt;
                                          {{ wtf.form_field(form.remember) }}
                                      &lt;/div&gt;
  
                                      &lt;div class="modal-footer"&gt;
                                         &lt;input class="btn btn-lg btn-primary btn-block" style="background-color: #3eb2a0;border-color: #3eb2a0;" type="submit" value="Sign In"&gt;
                                      &lt;/div&gt;
                                  &lt;/dl&gt;
                              &lt;/form&gt;
  
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
  </code></pre>