# Best practice form in modal

**URL:** <https://community.weweb.io/t/best-practice-form-in-modal/10613>\
**Category:** Ask us anything\
**Tags:** modal\
**Created:** [September 3, 2024, 11:52am UTC](https://community.weweb.io/t/best-practice-form-in-modal/10613 "2024-09-03T11:52:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FHEXL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/fhexl/32/13607_2.png) [@FHEXL](https://community.weweb.io/u/FHEXL)\
**Post date:** [September 3, 2024, 11:52am UTC](https://community.weweb.io/t/best-practice-form-in-modal/10613/1 "2024-09-03T11:52:45Z")

</div>

Hi there,

I was wondering how to best structure a form in a modal.

For what I understand a submit button needs to be a child element of the form it is submitting.

But I want to use the footer button of the modal to submit the form. To be able to do this, I make the form the root element of the modal. Then I place the header, body and footer of the modal in the form.

Formfields are placed in de modal body element.

It works, but I would like to know if there is a better approach.
