Is it possible to fill in the password field in wtforms in the bulb?
I tried this:
capform = RECAPTCHA_Form()
capform.username.data = username
capform.password.data = password
The shape is defined as follows:
class RECAPTCHA_Form(Form):
username = TextField('username', validators=[DataRequired()])
password = PasswordField('password', validators=[DataRequired()])
remember_me = BooleanField('Remember me.')
recaptcha = RecaptchaField()
The template is as follows:
<form method="POST" action="">
{{ form.hidden_tag() }}
{{ form.username(size=20) }}
{{ form.password(size=20) }}
{% for error in form.recaptcha.errors %}
<p>{{ error }}</p>
{% endfor %}
{{ form.recaptcha }}
<input type="submit" value="Go">
</form>
I tried changing PasswordFieldto TextField, and then it works.
Is there any special restriction to populate PasswordFields in wtforms?
source
share