Best practice for handling different forms

Hello there,
I am currently planning to develop an app and wondering about best practice handling different form options. I will shorty explain:
Use case:
A user can create a project and select a project type. Depending on the type of project, there is a corresponding form collecting information about the project. The right form for each project type should be displayed depending on the project type. There will be a create, show and edit page for the form. It is likely that the number of project type options will increase in the future.

Now my question:

  1. Is it good practice to create a section on a single page for each form variant and then hide and display sections depending on the selected project type. What other options are there? There will be at least 5, but not more than 20 different form sections, 1 active at a time.

  2. What options are there to create (and style) a form template that can be reused when creating a new form variant? Is this a usecase for a component or is it easier to just copy the whole section.

Thank you in advance for your help,

Jakob

Hi @JakobM :wave:

For your first question, you have two main options:

  1. all the forms in one page with conditional rendering to ensure the page doesn’t slow down because it’s too heavy. learn more here: Conditional rendering | WeWeb documentation

  2. each form on a separate page, using multi-page sections to ensure the navigation and user experience remain fast and smooth. learn more here: Multi-page sections | WeWeb documentation

There’s no right or wrong approach though my personal preference is with the separate page approach because I find it easier to maintain, working on each page separately.

For your second question, you can use components or section templates to avoid doing the same work multiple times. Learn more here: Intro to libraries | WeWeb documentation

I hope that helps! Good luck with this project :slight_smile: Don’t hesitate to reach out again if there’s anything else we can help you with.