How to get a value using flask, from a selected option in a drop down list?
Answers
Answered by
1
Answer:
from flask import Flask, render_template,request, redirect, url_for
app = Flask(__name__)
def template(title = "HELLO!", text = ""):
templateDate = {
'text' : text
}
return templateDate
@app.route("/threshold", methods=['POST'])
def threshold():
tvalue= (request.form.get['tvalue']) #get value from dropdown
msg= ""
if tvalue>3:
msg= "rating above 3"
templateData = template(text = msg) #display text using template()
#templateData = template(text = tvalue) #tried to print the value selected
return render_template('index.html'
Answered by
0
I don't know reh bhaiya
Similar questions