{% for movie in movies%}
<div class="card">
<form action="moviedetail.html" method="post">
<input type="image" class="card-img-top" name = "posterurl" value="{{movie}}" alt="poster" src="{{movie}}">
</form>
</div>
{% endfor %}
Here is the code on the html, I just created a bunch of input forms with a for loop. I want to post the data {{movie}} to the next page on click.
@data.route("/moviedetail.html", methods=['POST'])
def getMovieDetail():
poster = request.form['posterurl']
return render_template("moviedetail.html", poster = poster)
Here is the receiving end on the mainroutes.py. I keep getting a 400 error, bad key request on ['posterurl']. Im guessing the error is because I created multiple forms with a for loop using the same name, but I can't think of any other way to post the data.