Reputation: 4356
How can I use Jinja2 and Flask to get the hidden variable in this code:
<form action="reservation" method="post" name="reservation">
<td><button type="button" class="btn btn-primary">Reservation</button></td>
<input type="hidden" name="id" value="{{ d[0] }} ">
</form>
It would be better may be to use GET but I am stuck with this also.
Upvotes: 1
Views: 3788
Reputation: 1124388
It is just another form field. It may be hidden in your browser, but it is still sent to your Flask server just like any other field.
As such, it'll be found in your request.form
multidict:
id = request.form.get('id')
Upvotes: 4