Here is the html and flask python code. When user select Audi from drop down menu I wanted that it give the Done as answer. I am getting 400 bad request error.
form.html
<!DOCTYPE html>
<html>
<body>
<p>Select a new car from the list.</p>
<form id="form1" action="/login" method="GET" enctype="multipart/form-data">
<select id="mySelect" name = "cars">
<option value="Audi">Audi</option>
<option value="BMW">BMW</option>
<option value="Mercedes">Mercedes</option>
<option value="Volvo">Volvo</option>
</select>
</form>
<p>When you select a new car, a function is triggered which outputs the value of the selected car.</p>
</body>
</html>
app.py
from flask import Flask, render_template, redirect, url_for,request
from flask import make_response
app = Flask(__name__)
@app.route('/login', methods=['GET','POST'])
def login():
c=str((request.form['cars']))
print(c)
if(c == "Audi"):
print("Done")
return render_template('form.html')
