I'm attempting to get the invoice number from a button. This number changes with Jinja. I've looked at the following answer but it's not helping. Nothing is printing. Can someone please help?
How to get the value of a variable within an html tag in flask?
HTML
<form><th><Button class="btn btn-dark" name="invoice_no" value="{{ i.invoice_no }}">Select Invoice</Button></th></form>
Flask
if request.method == "POST":
# Retrieve invoice number from button
if request.form.get('invoice_no'):
invoice = request.form.get('invoice_no')
print(invoice)
print("print test")
Output is correct: invoice_no=3
INFO: 127.0.0.1 - - [24/Aug/2022 20:17:43] "GET /transactions?invoice_no=3 HTTP/1.1" 200 -