flask jinja2. Can you match the name of the text box to the array?
I have defined an array in python that I want to use to name multiple text boxes, but prompt The browser (or proxy) sent a request that this server could not understand.
related codes
html:
< form method= "post" action = "/ FlaskTutorial" >
{% for i in dict %}
<tr>
<td>{{ i[0] }}</td>
<td>{{ i[3] }}</td>
<td>{{ i[1] }}</td>
<td>{{ i[4] }}</td>
<td>{{ i[2] }}</td>
<td><input type="text" name={{ subs[loop.index0] }} placeholder=""></td>
<br></br>
</tr>
{% endfor %}
<br></br>
<input type="submit" value="" name="OK"/>
< / form >
python:
@ app.route ("/ login")
def index ():
return render_template("login.html",dict=dict,subs=subs)
@ app.route ("/ FlaskTutorial",methods= ["POST"])
def success ():
if request.method=="POST":
value=request.form["subs"]
return render_template("success.html",value=value)
else:
pass