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?