I am creating a form, where someone chooses a team and then the team's location should be outputted in a div.
Here is what I have so far. How do I get the location from the correct team - the one that is chosen by the user?
<select id="chooseTeam" name="chooseTeam" data-placeholder="Select Team">
<option></option>
{% for team in teams %}
<option>{{team.name}}</option>
{% endfor %}
</select>
<div>{{team.location}}</div>
class Team(db.Model):
__tablename__ = 'Team'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String())
location = db.Column(db.String())