flask identify different forms on same page
if 'my_form_element_name' in request.form:
print ('stuff')
flask identify different forms on same page
if 'my_form_element_name' in request.form:
print ('stuff')
handling multiple forms flask
<form>
<input type="hidden" name="form-name" value="form1">
</form>
<form>
<input type="hidden" name="form-name" value="form2">
</form>
def some_view():
form1 = SomeForm()
form2 = AnotherForm()
if request.method == 'POST':
form_name = request.form['form-name']
if form_name == 'form1':
form1.validate()
...
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us