I have a button that is defined inside a form:
<form action="" method="POST" id="form1">
<input type="hidden" name="form_name" value="form1" />
<input type="text" placeholder="Write something" name="text_input"/>
<button type="submit" form="form2" id="submit_button2">Click to save other form!</button>
<button type="submit" id="submit_button1">Click to save form!</button>
</form>
And another form:
<form action="" method="POST" id="form2">
<input type="hidden" name="form_name" value="form2" />
<input type="text" placeholder="Write something else" name="other_text_input" />
</form>
When I hit submit_button2 I would like to only get the inputs only in form2 and when I click on submit_button1 I would like to get all the inputs only in form1 in my flask server. However, it doesn’t work and I don’t understand why.