There is such a model.
public class FormModel { public string FormTitle { get; set; } public string FormDescription { get; set; } public ICollection<BlockWorkingFieldForm> Fields { get; set; } } public class BlockWorkingFieldForm { public string FieldHeader { get; set; } public string FieldType { get; set; } public string Field { get; set; } public bool FieldQuestion { get; set; } } And there is a form, it consists of two parts.
- FormTitle and FormDescription are normal input fields.
- And BlockWorkingFieldForm is a block (input, chexbox and select), which can be added as many times as necessary (adding occurs at the bottom of the form, that is, not arbitrarily) and delete the created blocks in a random order. However, at least one BlockWorkingFieldForm must be present. Well, actually, when you click the Submit button, the form should go to the server and fill in the model.
On the client side only jQuery, but you can use other tools, if it helps to solve the problem.
I certainly found one way described in this article ( https://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx/ ), but the article is already 10 years old, are there any other ways ?