I'm trying to create a dynamic number of HTML input text fields, where the number comes posted from another form. But Flask interprets the form number 10
as 1 0
, i.e. 2
(string length).
The first form:
<form action="/new_vocals" method="post">
<input type="text" name="count">
<input type="submit">
The Flask app route:
@app.route("/new_vocals", methods=['POST', 'GET'])
def new_vocals():
voc_count = request.form['count']
return render_template("new_vocals.html", count=voc_count)
Trying to use voc_count
in a for
loop, I get 2 input types with the value 10
, 3 with 100
and so on.
There has to be a way to get Flask to interpret 10
as a string?