title: Flask-WTF validate_on_submit() not executed
body: <p>I am unable to figure out why my form will not validate. I have made sure that the CSRF field is inserted in to the HTML with <code>form.hidden_tag</code></p>
  
  <p>Here is the code for my registration form:</p>
  
  <pre><code>from flask_wtf import FlaskForm
  from wtforms import StringField, PasswordField, SubmitField, BooleanField
  from wtforms.validators import DataRequired, Length, Email, EqualTo
  
  
  class RegistrationForm(FlaskForm):
      username = StringField('Username', validators=[DataRequired(), Length(min=2, max=20)])
      email = StringField('Email', validators=[DataRequired(), Email()])
      password = PasswordField('Password', validators=[DataRequired()])
      confirm_password = PasswordField('Confirm Password', validators=[DataRequired(), EqualTo(password)])
      submit = SubmitField('Register')
  </code></pre>
  
  <p>Here is the function in which I am checking to see if the form is validated. It does submit, as the program prints out 'submitted' into my terminal</p>
  
  <pre><code>@app.route('/register', methods=['GET', 'POST'])
  def register():
      form = RegistrationForm()
      if form.is_submitted():
          print("submitted")
      if form.validate_on_submit():
          flash(f'Account created for {form.username.data}!', 'success')
          return redirect(url_for('home'))
      print(forms.errors)
      return render_template('register.html', title='Register', form=form)
  </code></pre>
  
  <p>Using <code>forms.errors</code>, I get the following error message:</p>
  
  <pre><code>{'confirm_password': ["Invalid field name '&lt;UnboundField(PasswordField, ('Password',), {'validators': [&lt;wtforms.validators.DataRequired object at 0x00000205913D2F28&gt;]})&gt;'."]}
  </code></pre>
  
  <p>I am unsure of what this means.</p>
  
  <p>If it helps, I have all my current code located on GitHub: <a href="https://github.com/tomajohnson21/FakeBook" rel="nofollow noreferrer">https://github.com/tomajohnson21/FakeBook</a></p>