Are form containers required?

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?

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

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

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.

what is the field validation for simple input field?

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

1 Like

I think it validates the fieldt type

and if required, that the field is filled.