I'm trying to transfer formdata from html into a database, but when i try to send the content i got an empty Dict.
html looks like this:
...
<form id="set" action="/settings" method="POST">
<h3>Name</h3>
<input type="text" class="input" name="name" id="name" value={{name}}>
<h3>Email</h3>
<input type="text" class="input" name="email" id="email" value={{email}}>
<br><button class="btn" type="submit" form="set">Update</button>
</form>
...
pythoncode looks like this:
...
@app.route("/settings", methods=['POST'])
@login_required
def settings():
if request.method == 'POST':
name = request.form['name']
email = request.form['email']
...
then i got this error:
werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
KeyError: 'name'
so i printed out the dict
ImmutableMultiDict([])
and saw it was empty. But why? What do i have to change?
Btw i'm using multiple forms in this html, but i dont think this is the problem.