Use hx-include
- https://htmx.org/attributes/hx-include/.
<div>
<form id="myform">
<input type="text" name="field1"/>
</form>
</div>
<div>
<button hx-post="" hx-include="#myform"></button>
</div>
This will submit all the child-inputs in the myform
tag.