populate WTForms select field using value selected from previous field
New to this, trying to build an app following a well known Flask tutorial, using Flask-bootstrap, Flask-wtforms, Jinja etc I have a form with 2 select fields and a button. class Form(FlaskForm): school_year = SelectField('School year', choices=some_tuples_list) category = SelectField('Category', choices=[]) submit = SubmitField('submit') I want only the first field to be pre-populated, and the other to get populated (on the client side?) based on the previous field's selected value. In the template I try something like {{ form.school_year(**{"onchange":"getCategories()"}) }} which works ok