[Answer]-Why does my html form fields reset? (django project deployed on heroku)

1👍

For your year form, you have:

if query:
    form = SearchFormByYear({'query':query})

Which creates a form with the initial value of query. You don’t do this for your FindCombo form and, if you want to create it with the already-selected values, you should.

Something like:

form = FindCombo({'choose_gender': gender, 'choose_race': race, 'choose_party': party})

Leave a comment