...

/

Dynamically Manage Form Sections

Dynamically Manage Form Sections

Learn how to manage dynamically form controls at runtime.

Until now, we set the forms’ shapes from the beginning, only changing validation rules dynamically but without altering the form controls’ structure. This is the most common case as the given requirements determine how to design the form fields and don’t change at runtime. However, in some particular scenarios, we sometimes need some extra flexibility.

In this lesson, we’ll learn how it’s possible to change the model of a form at runtime. Giving the user the possibility to add parts of the form is very convenient in those cases where we don’t know how many fields are necessary. This is because it can vary and depends on the single user.

For example, our application can offer the possibility of registering multiple addresses for each account: one for the domicile, one for the business, one for the summer vacations, and possibly more. It wouldn’t be possible to know how many addresses are needed upfront and ...