# Are form containers required?

**URL:** <https://community.weweb.io/t/are-form-containers-required/13987>\
**Category:** Ask us anything\
**Tags:** workflows, binding, modal, supabase\
**Created:** [October 17, 2024, 11:32am UTC](https://community.weweb.io/t/are-form-containers-required/13987 "2024-10-17T11:32:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rice](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/rice/32/11161_2.png) [@rice](https://community.weweb.io/u/rice)\
**Post date:** [October 17, 2024, 11:32am UTC](https://community.weweb.io/t/are-form-containers-required/13987/1 "2024-10-17T11:32:39Z")

</div>

Hello

I was reading through the documentation on form containers for a separate use but I noticed it says that it is the go-to element for user inputs. At this point, I had already put together a “form” inside of a modal. In my case, it was used for adding a vehicle by creating a new entry in the database on submit.

I first added a modal which had a container already where I added my own dropdown and input fields. Then I renamed the “element name” for each field. (Example: the dropdown element for “vehicle year” I renamed as “vehicle\_year”). Lastly, I created a workflow on the submit button that started with “On click” \> Supabase INSERT to the appropriate database \> selected only needed columns (like vehicle year, make, model, etc) \> Set variable modalIsOpened = false. To open this modal, I have a “+Add” button on the page which sets modalIsOpened = true.

I tested it a few times and it works flawlessly. Obviously if it ain’t broken, don’t try to fix it. But I’m left wondering if I did something wrong here. The documentation explicitly says not to add the workflow to the submit button in order to validate properly but rather it should be added to the form container itself. In my case, I never even added a form container. In fact, I added the workflow to the submit button.

I set a few fields as “Required” and the form works as intended. It does not allow submit unless all required fields are complete.

Should I go back and re-do the entire modal with an actual form container?

---

<div class="post-metadata">

**Author:** ![pitt2k](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@pitt2k](https://community.weweb.io/u/pitt2k)\
**Post date:** [October 17, 2024, 3:16pm UTC](https://community.weweb.io/t/are-form-containers-required/13987/2 "2024-10-17T15:16:49Z")

</div>

I never use for containers and all works fine.  
But I’m happy to hear from others.

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [October 17, 2024, 3:24pm UTC](https://community.weweb.io/t/are-form-containers-required/13987/3 "2024-10-17T15:24:01Z")

</div>

You should use forms, you’re missing out on automatic validation

---

<div class="post-metadata">

**Author:** ![archenia\_jsanchez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/archenia_jsanchez/32/8656_2.png) [@archenia\_jsanchez](https://community.weweb.io/u/archenia_jsanchez)\
**Post date:** [October 17, 2024, 8:54pm UTC](https://community.weweb.io/t/are-form-containers-required/13987/4 "2024-10-17T20:54:37Z")

</div>

Mixed feelings.

You get field validation for free and and if memory serves me well, pressing enter on your keyboard to submit the form too.

If I want to style my own validation, then I don’t care as much.

---

<div class="post-metadata">

**Author:** ![pitt2k](https://avatars.discourse-cdn.com/v4/letter/p/e8c25b/32.png) [@pitt2k](https://community.weweb.io/u/pitt2k)\
**Post date:** [October 18, 2024, 5:05am UTC](https://community.weweb.io/t/are-form-containers-required/13987/5 "2024-10-18T05:05:26Z")

</div>

what is the field validation for simple input field?

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [October 18, 2024, 10:14am UTC](https://community.weweb.io/t/are-form-containers-required/13987/6 "2024-10-18T10:14:29Z")

</div>

> [@archenia\_jsanchez](#):
>
> If I want to style my own validation, then I don’t care as much.

I’m working on a component that will change this. Also WeWeb is. I highly reccomend you use forms.

---

<div class="post-metadata">

**Author:** ![archenia\_jsanchez](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/archenia_jsanchez/32/8656_2.png) [@archenia\_jsanchez](https://community.weweb.io/u/archenia_jsanchez)\
**Post date:** [October 18, 2024, 2:58pm UTC](https://community.weweb.io/t/are-form-containers-required/13987/7 "2024-10-18T14:58:13Z")

</div>

I think it validates the fieldt type

 ![Screenshot 2024-10-18 at 10.55.58 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/9/9d4424da0d4a6ecb911fc60a808638c76670aa4d.png)  
 ![Screenshot 2024-10-18 at 10.55.45 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/e6084912a0df91cd1c90c30deb514374797e1e1d.png)

and if required, that the field is filled.

 ![Screenshot 2024-10-18 at 10.51.26 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/1/1b968ba5f36814367cac5e97cb2b1e1309f0d732.png)  
 ![Screenshot 2024-10-18 at 10.57.04 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/9/915604794c18f8611a4ed6bc3a5914f35641fa2e.png)
