Is it possible to add form fields to an already rendered page?
The situation is that I have a form for a model that has an embedded entity, and the relationship is one to many, and I don't know ahead of time how many there may be. I'd like to have the option to add a new "row" to the form, which accounts for additional items in the relationship.
The model form represents an item like this:
{
"Id": 1,
"Discriminator": "Distributor",
"id": "Distributor|1",
"ShippingCenters": [
{
"id": 1,
"City": "Phoenix",
"Street": "500 S 48th Street"
},
{
"id": 2,
"City": "Anaheim",
"Street": "5650 Dolly Ave"
}
],
}
Essentially I need to dynamically add 3 fields at a time to the form, every time an "add shipping center" button is clicked.
Field 1 - NumericTextBox (id)
Field 2 -
TextBox (city)
Field 3 -
TextBox (street)
I appreciate any guidance. :)